Resource allocation method and apparatus

ABSTRACT

Embodiments of the present invention relate to the field of communications technologies, and provide a resource allocation method and an apparatus. The method includes: receiving a resource allocation request from first UE, wherein the first user equipment (UE) is any UE within coverage of a base station, obtaining location information of the first UE, determining, according to the location information of the first UE and location information of UEs to which transmission resources are currently already allocated, second UE that meets a preset condition, allocating, to the first UE, a transmission resource already allocated to the second UE; and sending the allocated transmission resource to the first UE.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/829,583, filed on Dec. 1, 2017, which is a continuation ofInternational Application No. PCT/CN2015/080598, filed on Jun. 2, 2015.All of the afore-mentioned patent applications are hereby incorporatedby reference in their entireties.

TECHNICAL FIELD

The present invention relates to the field of communicationstechnologies, and in particular, to a resource allocation method and anapparatus.

BACKGROUND

IoV (Internet of Vehicles, Internet of Vehicles) is a new managementservice network based on a combination of the Internet and the Internetof Things technologies and integrating multitudinous softwaretechnologies and information service content. In the Internet ofVehicles, with vehicles as nodes and information sources,“human-vehicle-road-environment-society” communication is implemented byusing advanced sensing technologies, network technologies, and wirelesscommunications technologies, and by means of mass information processingand sharing by using vehicles or mobile phones. In this way, intelligentidentification, positioning, tracking, supervision, and push servicesare achieved, and drive experience and services that are moreintelligent, safer, more environment-friendly, and more comfortable areimplemented.

Because a vehicle is equipped with a communications unit, the vehiclemay be considered as UE (User Equipment, user equipment). In the priorart, before the UE needs to communicate with another UE or anotherdevice, the UE may send a transmission resource request to a basestation. When the base station receives the transmission resourcerequest sent by the UE, the base station cannot determine a location ofthe terminal according to the transmission resource request. Therefore,the base station allocates different transmission resources to differentUEs to avoid a transmission collision that may be caused by allocating asame transmission resource to vehicles when locations of the vehiclesare unknown. In this way, the UE can normally communicate with theanother UE by using the allocated transmission resource, and further,“human-vehicle-road-environment-society” communication is implemented.

In a process of implementing the present invention, the inventor findsthat the prior art has at least the following problem:

When there are a large quantity of UEs in cells within coverage of thebase station, and the vehicles require a large quantity of transmissionresources, because the transmission resources within the coverage areaof the base station are limited and cannot be multiplexed, the basestation possibly has no remaining resource for allocation. Consequently,some vehicles cannot perform communication, a transmission resourcemultiplex rate is low, and communication efficiency of the vehicles islow.

SUMMARY

To implement proper transmission resource allocation and increase atransmission resource multiplex rate and a success rate of communicationbetween vehicles in the Internet of Vehicles, embodiments of the presentinvention provide a resource allocation method and an apparatus. Thetechnical solutions are as follows:

According to a first aspect, a base station is provided, and the basestation includes:

a receiving module, configured to receive a resource allocation requestsent by first user equipment UE, where the first UE is any UE withincoverage of the base station;

an allocation module, configured to allocate, if the resource allocationrequest received by the receiving module carries a transmission resourceindex obtained by the first UE through listening, a transmissionresource to the first UE according to the transmission resource index;and

a sending module, configured to send, to the first UE, the transmissionresource allocated by the allocation module.

With reference to the first aspect, in a first possible implementationof the first aspect, the sending module is further configured to sendlistening setting information to the UE within the coverage of the basestation before the receiving module receives the resource allocationrequest sent by the first UE, where the listening setting information isused to notify the UE of a duration of listening.

With reference to the first possible implementation, in a secondpossible implementation of the first aspect, the sending module isspecifically configured to:

send radio resource control protocol RRC signaling to the UE within thecoverage of the base station, where the RRC signaling carries thelistening setting information; or

send a system information block SIB message to the UE within thecoverage of the base station, where the SIB message carries thelistening setting information; or

send control signaling to the UE within the coverage of the basestation, where the control signaling carries the listening settinginformation.

With reference to the foregoing possible implementation, in a thirdpossible implementation of the first aspect, the sending module isfurther configured to send energy threshold information to the UE withinthe coverage of the base station before the receiving module receivesthe resource allocation request sent by the first UE, where the energythreshold information is used to notify the UE of a first energythreshold in listening.

With reference to the third possible implementation, in a fourthpossible implementation of the first aspect, the sending module isspecifically configured to:

send RRC signaling to the UE within the coverage of the base station,where the RRC signaling carries the energy threshold information; or

send a SIB message to the UE within the coverage of the base station,where the SIB message carries the energy threshold information; or

send control signaling to the UE within the coverage of the basestation, where the control signaling carries the energy thresholdinformation.

With reference to the foregoing possible implementation, in a fifthpossible implementation of the first aspect, the sending module isfurther configured to send quantity setting information to the UE withinthe coverage of the base station before the receiving module receivesthe resource allocation request sent by the first UE, where the quantitysetting information is used to notify the UE of a quantity oftransmission resource indexes to be carried when the resource allocationrequest is sent.

With reference to the foregoing possible implementation, in a sixthpossible implementation of the first aspect, the base station furtherincludes:

a judging module, configured to determine, if the resource allocationrequest does not carry any transmission resource index, whether the basestation has any unallocated transmission resource; where

when the judging module determines that the base station has anunallocated transmission resource, the allocation module is furtherconfigured to allocate the unallocated transmission resource to thefirst UE; or

an obtaining module, configured to obtain location information of thefirst UE when a judging module determines that all transmissionresources of the base station are already allocated; and

a determining module, configured to determine, according to the locationinformation of the first UE that is obtained by the obtaining module andlocation information of UEs to which the allocation module currently hasalready allocated transmission resources, second UE that meets a presetcondition, where the preset condition is that a distance between thesecond UE and the first UE is greater than a first preset distance;where

the allocation module is further configured to allocate, to the firstUE, a transmission resource already allocated to the second UEdetermined by the determining module.

With reference to the foregoing possible implementation, in a seventhpossible implementation of the first aspect, the receiving module isfurther configured to receive the location information of the first UE;and

the obtaining module is configured to obtain the location informationreceived by the receiving module, as the location information of thefirst UE; or

the obtaining module is configured to determine the location informationof the first UE according to a transmit signal of the first UE; or

the obtaining module is configured to use location information of thefirst UE that is previously obtained by the obtaining module, as currentlocation information of the first UE.

With reference to the foregoing possible implementation, in an eighthpossible implementation of the first aspect, the receiving module isspecifically configured to:

receive global positioning system GPS location information of the firstUE; or receive estimated location information of the first UE, where theestimated location information is location information obtained by thefirst UE through estimation according to a positioning reference signaltransmitted by the base station; or receive area index information of anarea in which the first UE is currently located.

With reference to the foregoing possible implementation, in a ninthpossible implementation of the first aspect, the obtaining module isspecifically configured to: determine a relative azimuth between thefirst UE and the base station according to the transmit signal of thefirst UE; and determine a distance between the first UE and the basestation according to a detected energy value of the transmit signal ofthe first UE.

With reference to the foregoing possible implementation, in a tenthpossible implementation of the first aspect, the transmit signal of thefirst UE is:

a physical uplink control channel PUCCH signal; or

a physical uplink shared channel PUSCH signal; or

a random access channel RACH; or

a PUCCH signal used to carry a scheduling request SR; or

a PUSCH signal used to carry a buffer status report BSR; or

a communication signal between the first UE and another UE.

With reference to the foregoing possible implementation, in an eleventhpossible implementation of the first aspect, the base station furtherincludes:

a collision determining module, configured to determine whether aresource collision exists between the first UE and the second UE; wherethe allocation module is further configured to reallocate a transmissionresource to the first UE or the second UE when the collision determiningmodule confirms that the resource collision exists between the first UEand the second UE.

With reference to the foregoing possible implementation, in a twelfthpossible implementation of the first aspect, the sending module isfurther configured to send a resource multiplex message to the first UEand the second UE separately after the allocation module allocates, tothe first UE, the transmission resource already allocated to the secondUE determined by the determining module, where the resource multiplexmessage is used to notify that the same transmission resource isallocated to the first UE and the second UE.

With reference to the foregoing possible implementation, in a thirteenthpossible implementation of the first aspect, the collision determiningmodule is specifically configured to: determine, in real time accordingto the location information of the first UE and location information ofthe second UE, whether the distance between the first UE and the secondUE is less than a second preset distance; and when confirming that thedistance between the first UE and the second UE is less than the secondpreset distance, determine that the resource collision exists betweenthe first UE and the second UE.

With reference to the foregoing possible implementation, in a fourteenthpossible implementation of the first aspect, the collision determiningmodule is further configured to:

when the receiving module receives a resource collision message sent bythe first UE, determine that the resource collision exists between thefirst UE and the second UE, where the resource collision message isobtained by the first UE by performing detection on the transmissionresource at a silent time; or when the receiving module receives aresource collision message sent by the second UE, determine that theresource collision exists between the first UE and the second UE, wherethe resource collision message is obtained by the second UE byperforming detection on the transmission resource at a silent time.

With reference to the foregoing possible implementation, in a fifteenthpossible implementation of the first aspect, the sending module isfurther configured to send silence setting information to the first UEand the second UE separately after the allocation module allocates, tothe first UE, the transmission resource already allocated to the secondUE determined by the determining module, where the silence settinginformation is used to instruct the UEs to keep silent in a specifiedtransmission timeslot.

With reference to the foregoing possible implementation, in a sixteenthpossible implementation of the first aspect, when the receiving modulereceives a resource collision message sent by third UE, the collisiondetermining module is further configured to determine that the resourcecollision exists between the first UE and the second UE, where the thirdUE is UE different from the first UE and the second UE within thecoverage of the base station, and the resource collision message isobtained by the third UE by performing detection on the transmissionresource.

With reference to the foregoing possible implementation, in aseventeenth possible implementation of the first aspect, the sendingmodule is further configured to send a broadcast message to the UEwithin the coverage of the base station, where the broadcast messagecarries a transmission resource index allocated to the first UE and thesecond UE, and the transmission resource index is used by the UE withinthe coverage of the base station to perform detection on thetransmission resource.

According to a second aspect, user equipment is provided, and the userequipment includes:

a receiving module, configured to receive listening setting information,where the listening setting information is used to notify the UE of aduration of listening;

a determining module, configured to determine, according to thelistening setting information received by the receiving module, aduration of listening to be performed on transmission resources withincoverage of a base station;

a listening module, configured to listen to the transmission resourceswithin the coverage of the base station; and

a sending module, configured to send a resource allocation request tothe base station when a duration of the listening performed by thelistening module reaches the preset duration determined by thedetermining module, so that the base station allocates a transmissionresource according to the resource allocation request; where

the receiving module is further configured to receive the transmissionresource allocated by the base station.

With reference to the second aspect, in a first possible implementationof the second aspect, the listening module is specifically configuredto: perform energy detection on the transmission resource to obtain adetected energy value; and when the detected energy value is less than afirst energy threshold, obtain a transmission resource index of thetransmission resource.

With reference to the foregoing possible implementation, in a secondpossible implementation of the second aspect, the resource allocationrequest carries the transmission resource index of the transmissionresource.

With reference to the foregoing possible implementation, in a thirdpossible implementation of the second aspect, the receiving module isfurther configured to receive energy threshold information from the basestation before the listening module listens to the transmissionresources within the coverage of the base station, where the energythreshold information is used to notify the UE of the first energythreshold in listening.

With reference to the foregoing possible implementation, in a fourthpossible implementation of the second aspect, before the listeningmodule listens to the transmission resources within the coverage of thebase station, the receiving module is further configured to receivequantity setting information sent by the base station, where thequantity setting information is used to notify the UE of a quantity oftransmission resource indexes to be carried when the resource allocationrequest is sent.

With reference to the foregoing possible implementation, in a fifthpossible implementation of the second aspect, the sending module isfurther configured to send location information of the user equipment tothe base station when it is determined that no transmission resourcelistened to by the listening module is idle.

With reference to the foregoing possible implementation, in a sixthpossible implementation of the second aspect, the sending module isspecifically configured to:

send GPS location information to the base station; or send estimatedlocation information to the base station, where the estimated locationinformation is location information obtained by the user equipmentthrough estimation according to a positioning reference signaltransmitted by the base station; or send area index information of anarea in which the user equipment is currently located to the basestation.

With reference to the foregoing possible implementation, in a seventhpossible implementation of the second aspect, after receiving thetransmission resource allocated by the base station, the receivingmodule is further configured to receive a resource multiplex messagesent by the base station; and

the sending module is further configured to periodically send locationinformation of the user equipment to the base station, so that the basestation determines, according to the location information of the userequipment, whether a resource collision exists.

With reference to the foregoing possible implementation, in an eighthpossible implementation of the second aspect, after receiving thetransmission resource allocated by the base station, the receivingmodule is further configured to receive silence setting information sentby the base station, where the silence setting information is used toinstruct the UE to keep silent in a specified transmission timeslot; and

the user equipment further includes:

a silence module, configured to keep silent in the specifiedtransmission timeslot according to the silence setting informationreceived by the receiving module;

a resource collision determining module, configured to determine, whenit is detected that a detected energy value of the transmission resourceoccupied by the user equipment in the specified transmission timeslotdetermined by the silence module is greater than a second energythreshold, that a resource collision exists; and

a message generation module, configured to generate a resource collisionmessage when the resource collision determining module determines thatthe resource collision exists; where

the sending module is further configured to send the resource collisionmessage generated by the message generation module to the base station.

According to a third aspect, user equipment is provided, and the userequipment includes:

a receiving module, configured to receive a broadcast message, where thebroadcast message carries a transmission resource index allocated tofirst UE and second UE;

a detection module, configured to perform detection on a transmissionresource according to the transmission resource index received by thereceiving module;

a generation module, configured to generate a resource collision messagewhen the detection module determines that a resource collision exists onthe transmission resource; and

a sending module, configured to send the resource collision messagegenerated by the generation module to a base station, so that the basestation determines, according to the resource collision message, thatthe resource collision exists between the first UE and the second UE.

With reference to the third aspect, in a first possible implementationof the third aspect, the detection module is specifically configured to:perform detection on the transmission resource corresponding to thetransmission resource index received by the receiving module; and if asignal is successfully detected on the transmission resource, but as theuser equipment moves, a change range of signal energy on thetransmission resource is less than a preset threshold, and no signal canbe successfully detected on the transmission resource again, and stillno signal can be successfully detected within a preset duration,determine that the resource collision exists between the first UE andthe second UE.

According to a fourth aspect, a base station is provided, and the basestation includes:

a receiving module, configured to receive a resource allocation requestfrom first UE, where the first UE is any UE within coverage of the basestation;

an obtaining module, configured to obtain location information of thefirst UE;

a determining module, configured to determine, according to the locationinformation of the first UE that is obtained by the obtaining module andlocation information of UEs to which transmission resources arecurrently already allocated, second UE that meets a preset condition,where the preset condition is that a distance between the second UE andthe first UE is greater than a first preset distance;

an allocation module, configured to allocate, to the first UE, atransmission resource already allocated to the second UE determined bythe determining module; and

a sending module, configured to send, to the first UE, the transmissionresource allocated by the allocation module.

With reference to the fourth aspect, in a first possible implementationof the fourth aspect, the obtaining module is specifically configured toobtain location information received by the receiving module, as thelocation information of the first UE; or the obtaining module isconfigured to determine the location information of the first UEaccording to a transmit signal of the first UE; or the obtaining moduleis configured to use location information of the first UE that ispreviously obtained, as current location information of the first UE.

With reference to the foregoing possible implementation, in a secondpossible implementation of the fourth aspect, the receiving module isspecifically configured to:

receive GPS location information of the first UE; or receive estimatedlocation information of the first UE, where the estimated locationinformation is location information obtained by the first UE throughestimation according to a positioning reference signal transmitted bythe base station; or receive area index information of an area in whichthe first UE is currently located.

With reference to the foregoing possible implementation, in a thirdpossible implementation of the fourth aspect, the obtaining module isspecifically configured to: determine a relative azimuth between thefirst UE and the base station according to the transmit signal of thefirst UE; and determine a distance between the first UE and the basestation according to a detected energy value of the transmit signal ofthe first UE.

With reference to the foregoing possible implementation, in a fourthpossible implementation of the fourth aspect, the transmit signal of thefirst UE is:

a physical uplink control channel PUCCH signal; or a physical uplinkshared channel PUSCH signal; or a random access channel RACH; or a PUCCHsignal used to carry a scheduling request SR; or a PUSCH signal used tocarry a buffer status report BSR; or a communication signal between thefirst UE and another UE.

With reference to the foregoing possible implementation, in a fifthpossible implementation of the fourth aspect, the base station furtherincludes:

a collision determining module, configured to determine whether aresource collision exists between the first UE and the second UE; where

the allocation module is further configured to reallocate a transmissionresource to the first UE or the second UE when the resource determiningmodule determines that the resource collision exists between the firstUE and the second UE.

With reference to the foregoing possible implementation, in a sixthpossible implementation of the fourth aspect, the sending module isfurther configured to send a resource multiplex message to the first UEand the second UE separately after sending, to the first UE, thetransmission resource allocated by the allocation module, where theresource multiplex message is used to notify that the same transmissionresource is allocated to the first UE and the second UE.

With reference to the foregoing possible implementation, in a seventhpossible implementation of the fourth aspect, the collision determiningmodule is specifically configured to: determine, in real time accordingto the location information of the first UE and location information ofthe second UE, whether the distance between the first UE and the secondUE is less than a second preset distance; and when confirming that thedistance between the first UE and the second UE is less than the secondpreset distance, determine that the resource collision exists betweenthe first UE and the second UE.

With reference to the foregoing possible implementation, in an eighthpossible implementation of the fourth aspect, the collision determiningmodule is specifically configured to: when the receiving module receivesa resource collision message sent by the first UE, determine that theresource collision exists between the first UE and the second UE, wherethe resource collision message is obtained by the first UE by performingdetection on the transmission resource at a silent time; or when thereceiving module receives a resource collision message sent by thesecond UE, determine that the resource collision exists between thefirst UE and the second UE, where the resource collision message isobtained by the second UE by performing detection on the transmissionresource at a silent time.

With reference to the foregoing possible implementation, in a ninthpossible implementation of the fourth aspect, the sending module isfurther configured to send silence setting information to the first UEand the second UE separately after sending, to the first UE, thetransmission resource allocated by the allocation module, where thesilence setting information is used to instruct the UEs to keep silentin a specified transmission timeslot.

With reference to the foregoing possible implementation, in a tenthpossible implementation of the fourth aspect, when the receiving modulereceives a resource collision message sent by third UE, the collisiondetermining module is specifically configured to determine that theresource collision exists between the first UE and the second UE, wherethe third UE is UE different from the first UE and the second UE withinthe coverage of the base station, and the resource collision message isobtained by the third UE by performing detection on the transmissionresource.

With reference to the foregoing possible implementation, in an eleventhpossible implementation of the fourth aspect, the sending module isfurther configured to send a broadcast message to the UE within thecoverage of the base station after sending, to the first UE, thetransmission resource allocated by the allocation module, where thebroadcast message carries a transmission resource index allocated to thefirst UE and the second UE, and the transmission resource index is usedby the UE within the coverage of the base station to perform detectionon the transmission resource.

According to a fifth aspect, user equipment is provided, and the userequipment includes:

a sending module, configured to send a resource allocation request to abase station; where

the sending module is configured to send location information of theuser equipment to the base station, so that the base station allocates atransmission resource according to the location information of the userequipment and location information of UEs to which transmissionresources are currently already allocated; and

a receiving module, configured to receive the transmission resourceallocated by the base station.

With reference to the fifth aspect, in a first possible implementationof the fifth aspect, the sending module is specifically configured to:

send GPS location information to the base station; or send estimatedlocation information to the base station, where the estimated locationinformation is location information obtained by the user equipmentthrough estimation according to a positioning reference signaltransmitted by the base station; or send area index information of anarea in which the user equipment is currently located to the basestation.

With reference to the foregoing possible implementation, in a secondpossible implementation of the fifth aspect, after receiving thetransmission resource allocated by the base station, the receivingmodule is further configured to receive a resource multiplex messagesent by the base station; and

the sending module is further configured to periodically send thelocation information of the user equipment to the base station, so thatthe base station determines, according to the location information ofthe user equipment, whether a resource collision exists.

With reference to the foregoing possible implementation, in a thirdpossible implementation of the fifth aspect, after receiving thetransmission resource allocated by the base station, the receivingmodule is further configured to receive silence setting information sentby the base station, where the silence setting information is used toinstruct the UE to keep silent in a specified transmission timeslot; and

the user equipment further includes:

a silence module, configured to keep silent in the specifiedtransmission timeslot according to the silence setting informationreceived by the receiving module;

a detection module, configured to perform detection on the transmissionresource occupied by the user equipment in the specified transmissiontimeslot when the silence module keeps silent;

a collision determining module, configured to determine, when thedetection module detects that a detected energy value of thetransmission resource occupied by the user equipment is greater than asecond energy threshold, that a resource collision exists; and

a generation module, configured to generate a resource collision messagewhen the collision determining module determines that the resourcecollision exists; where

the sending module is further configured to send the resource collisionmessage generated by the generation module to the base station.

According to a sixth aspect, a resource allocation method is provided,and the method includes:

receiving a resource allocation request sent by first UE, where thefirst UE is any UE within coverage of a base station;

if the resource allocation request carries a transmission resource indexobtained by the first UE through listening, allocating a transmissionresource to the first UE according to the transmission resource index;and

sending the allocated transmission resource to the first UE.

With reference to the sixth aspect, in a first possible implementationof the sixth aspect, before the receiving a resource allocation requestsent by first UE, the method further includes:

sending listening setting information to the UE within the coverage ofthe base station, where the listening setting information is used tonotify the UE of a duration of listening.

With reference to the first possible implementation, in a secondpossible implementation of the sixth aspect, the sending listeningsetting information to the UE within the coverage of the base stationincludes:

sending RRC signaling to the UE within the coverage of the base station,where the RRC signaling carries the listening setting information; or

sending a SIB message to the UE within the coverage of the base station,where the SIB message carries the listening setting information; or

sending control signaling to the UE within the coverage of the basestation, where the control signaling carries the listening settinginformation.

With reference to the foregoing possible implementation, in a thirdpossible implementation of the sixth aspect, before the receiving aresource allocation request sent by first UE, the method furtherincludes:

sending energy threshold information to the UE within the coverage ofthe base station, where the energy threshold information is used tonotify the UE of a first energy threshold in listening.

With reference to the third possible implementation, in a fourthpossible implementation of the sixth aspect, the sending energythreshold information to the UE within the coverage of the base stationincludes:

sending RRC signaling to the UE within the coverage of the base station,where the RRC signaling carries the energy threshold information; or

sending a SIB message to the UE within the coverage of the base station,where the SIB message carries the energy threshold information; or

sending control signaling to the UE within the coverage of the basestation, where the control signaling carries the energy thresholdinformation.

With reference to the foregoing possible implementation, in a fifthpossible implementation of the sixth aspect, before the receiving aresource allocation request sent by first UE, the method furtherincludes:

sending quantity setting information to the UE within the coverage ofthe base station, where the quantity setting information is used tonotify the UE of a quantity of transmission resource indexes to becarried when the resource allocation request is sent.

With reference to the foregoing possible implementation, in a sixthpossible implementation of the sixth aspect, after the receiving aresource allocation request sent by first UE, the method furtherincludes:

if the resource allocation request does not carry any transmissionresource index, determining whether the base station has any unallocatedtransmission resource; and

when determining that the base station has an unallocated transmissionresource, allocating the unallocated transmission resource to the firstUE; or

when determining that all transmission resources of the base station arealready allocated, obtaining location information of the first UE;

determining, according to the location information of the first UE andlocation information of UEs to which transmission resources arecurrently already allocated, second UE that meets a preset condition,where the preset condition is that a distance between the second UE andthe first UE is greater than a first preset distance;

allocating, to the first UE, a transmission resource already allocatedto the second UE.

With reference to the foregoing possible implementation, in a seventhpossible implementation of the sixth aspect, the obtaining locationinformation of the first UE includes:

receiving the location information of the first UE; or determining thelocation information of the first UE according to a transmit signal ofthe first UE; or

using previously obtained location information of the first UE ascurrent location information of the first UE.

With reference to the foregoing possible implementation, in an eighthpossible implementation of the sixth aspect, the receiving the locationinformation sent by the first UE includes:

receiving GPS location information of the first UE; or

receiving estimated location information of the first UE, where theestimated location information is location information obtained by thefirst UE through estimation according to a positioning reference signaltransmitted by the base station; or

receiving area index information of an area in which the first UE iscurrently located.

With reference to the foregoing possible implementation, in a ninthpossible implementation of the sixth aspect, the determining thelocation information of the first UE according to a transmit signal ofthe first UE includes:

determining a relative azimuth between the first UE and the base stationaccording to the transmit signal of the first UE; and determining adistance between the first UE and the base station according to adetected energy value of the transmit signal of the first UE.

With reference to the foregoing possible implementation, in a tenthpossible implementation of the sixth aspect, the transmit signal of thefirst UE is:

a physical uplink control channel PUCCH signal; or

a physical uplink shared channel PUSCH signal; or

a random access channel RACH; or

a PUCCH signal used to carry a scheduling request SR; or

a PUSCH signal used to carry a buffer status report BSR; or

a communication signal between the first UE and another UE.

With reference to the foregoing possible implementation, in an eleventhpossible implementation of the sixth aspect, after the sending theallocated transmission resource to the first UE, the method furtherincludes:

determining whether a resource collision exists between the first UE andthe second UE; and

when confirming that the resource collision exists between the first UEand the second UE, reallocating a transmission resource to the first UEor the second UE.

With reference to the foregoing possible implementation, in a twelfthpossible implementation of the sixth aspect, after the sending theallocated transmission resource to the first UE, the method furtherincludes:

sending a resource multiplex message to the first UE and the second UEseparately, where the resource multiplex message is used to notify thatthe same transmission resource is allocated to the first UE and thesecond UE.

With reference to the foregoing possible implementation, in a thirteenthpossible implementation of the sixth aspect, the determining whether aresource collision exists between the first UE and the second UEincludes:

determining, in real time according to the location information of thefirst UE and location information of the second UE, whether the distancebetween the first UE and the second UE is less than a second presetdistance; and

when confirming that the distance between the first UE and the second UEis less than the second preset distance, determining that the resourcecollision exists between the first UE and the second UE.

With reference to the foregoing possible implementation, in a fourteenthpossible implementation of the sixth aspect, the determining whether aresource collision exists between the first UE and the second UEincludes:

when receiving a resource collision message sent by the first UE,determining that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thefirst UE by performing detection on the transmission resource at asilent time; or

when receiving a resource collision message sent by the second UE,determining that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thesecond UE by performing detection on the transmission resource at asilent time.

With reference to the foregoing possible implementation, in a fifteenthpossible implementation of the sixth aspect, before the determiningwhether a resource collision exists between the first UE and the secondUE, the method further includes:

sending silence setting information to the first UE and the second UEseparately, where the silence setting information is used to instructthe UEs to keep silent in a specified transmission timeslot.

With reference to the foregoing possible implementation, in a sixteenthpossible implementation of the sixth aspect, the determining whether aresource collision exists between the first UE and the second UEincludes:

when receiving a resource collision message sent by third UE,determining that the resource collision exists between the first UE andthe second UE, where the third UE is UE different from the first UE andthe second UE within the coverage of the base station, and the resourcecollision message is obtained by the third UE by performing detection onthe transmission resource.

With reference to the foregoing possible implementation, in aseventeenth possible implementation of the sixth aspect, before thedetermining whether a resource collision exists between the first UE andthe second UE, the method further includes:

sending a broadcast message to the UE within the coverage of the basestation, where the broadcast message carries a transmission resourceindex allocated to the first UE and the second UE, and the transmissionresource index is used by the UE within the coverage of the base stationto perform detection on the transmission resource.

According to a seventh aspect, a resource allocation method is provided,and the method includes:

receiving listening setting information, where the listening settinginformation is used to notify UE of a duration of listening;

determining, according to the listening setting information, a durationof listening to be performed on transmission resources within coverageof a base station;

listening to the transmission resources within the coverage of the basestation;

when a duration of the listening reaches the preset duration, sending aresource allocation request to the base station, so that the basestation allocates a transmission resource according to the resourceallocation request; and

receiving the transmission resource allocated by the base station.

With reference to the seventh aspect, in a first possible implementationof the seventh aspect, the listening to the transmission resourceswithin the coverage of the base station includes:

performing energy detection on the transmission resource to obtain adetected energy value; and

when the detected energy value is less than a first energy threshold,obtaining a transmission resource index of the transmission resource.

With reference to the foregoing possible implementation, in a secondpossible implementation of the seventh aspect, the resource allocationrequest carries the transmission resource index of the transmissionresource.

With reference to the foregoing possible implementation, in a thirdpossible implementation of the seventh aspect, before the listening tothe transmission resources within the coverage of the base station, themethod further includes:

receiving energy threshold information from the base station, where theenergy threshold information is used to notify the UE of the firstenergy threshold in listening.

With reference to the foregoing possible implementation, in a fourthpossible implementation of the seventh aspect, before the sending aresource allocation request to the base station when a duration of thelistening reaches the preset duration, the method further includes:

receiving quantity setting information sent by the base station, wherethe quantity setting information is used to notify the UE of a quantityof transmission resource indexes to be carried when the resourceallocation request is sent; and

determining, according to the quantity setting request, the quantity oftransmission resource indexes to be carried in the resource allocationrequest.

With reference to the foregoing possible implementation, in a fifthpossible implementation of the seventh aspect, the method furtherincludes:

when determining that no transmission resource that is listened to isidle, sending location information of the user equipment to the basestation.

With reference to the foregoing possible implementation, in a sixthpossible implementation of the seventh aspect, the sending locationinformation of the user equipment to the base station includes:

sending GPS location information to the base station; or

sending estimated location information to the base station, where theestimated location information is location information obtained by theuser equipment through estimation according to a positioning referencesignal transmitted by the base station; or

sending area index information of an area in which the user equipment iscurrently located to the base station.

With reference to the foregoing possible implementation, in a seventhpossible implementation of the seventh aspect, after the receiving thetransmission resource allocated by the base station, the method furtherincludes:

receiving a resource multiplex message sent by the base station; and

periodically sending location information of the user equipment to thebase station, so that the base station determines, according to thelocation information of the user equipment, whether a resource collisionexists.

With reference to the foregoing possible implementation, in an eighthpossible implementation of the seventh aspect, after the receiving thetransmission resource allocated by the base station, the method furtherincludes:

receiving silence setting information sent by the base station, wherethe silence setting information is used to instruct the UE to keepsilent in a specified transmission timeslot;

keeping silent in the specified transmission timeslot according to thesilence setting information;

when detecting that a detected energy value of the transmission resourceoccupied by the user equipment in the specified transmission timeslot isgreater than a second energy threshold, determining that a resourcecollision exists;

when determining that the resource collision exists, generating aresource collision message; and

sending the resource collision message to the base station.

According to an eighth aspect, a resource allocation method is provided,and the method includes:

receiving a broadcast message, where the broadcast message carries atransmission resource index allocated to first UE and second UE;

performing detection on a transmission resource according to thetransmission resource index;

when determining that a resource collision exists on the transmissionresource, generating a resource collision message; and

sending the resource collision message to a base station, so that thebase station determines, according to the resource collision message,that the resource collision exists between the first UE and the secondUE.

With reference to the eighth aspect, in a first possible implementationof the eighth aspect, the performing detection on a transmissionresource according to the transmission resource index includes:

performing detection on the transmission resource corresponding to thetransmission resource index; and

if a signal is successfully detected on the transmission resource, butas the user equipment moves, a change range of signal energy on thetransmission resource is less than a preset threshold, and no signal canbe successfully detected on the transmission resource again, and stillno signal can be successfully detected within a preset duration,determining that the resource collision exists between the first UE andthe second UE.

According to a ninth aspect, a resource allocation method is provided,and the method includes:

receiving a resource allocation request from first UE, where the firstUE is any UE within coverage of a base station;

obtaining location information of the first UE;

determining, according to the location information of the first UE andlocation information of UEs to which transmission resources arecurrently already allocated, second UE that meets a preset condition,where the preset condition is that a distance between the second UE andthe first UE is greater than a first preset distance;

allocating, to the first UE, a transmission resource already allocatedto the second UE; and

sending the allocated transmission resource to the first UE.

With reference to the ninth aspect, in a first possible implementationof the ninth aspect, the obtaining location information of the first UEincludes:

receiving the location information of the first UE; or

determining the location information of the first UE according to atransmit signal of the first UE; or

using previously obtained location information of the first UE ascurrent location information of the first UE.

With reference to the foregoing possible implementation, in a secondpossible implementation of the ninth aspect, the receiving the locationinformation sent by the first UE includes:

receiving GPS location information of the first UE; or

receiving estimated location information of the first UE, where theestimated location information is location information obtained by thefirst UE through estimation according to a positioning reference signaltransmitted by the base station; or

receiving area index information of an area in which the first UE iscurrently located.

With reference to the foregoing possible implementation, in a thirdpossible implementation of the ninth aspect, the determining thelocation information of the first UE according to a transmit signal ofthe first UE includes:

determining a relative azimuth between the first UE and the base stationaccording to the transmit signal of the first UE; and

determining a distance between the first UE and the base stationaccording to a detected energy value of the transmit signal of the firstUE.

With reference to the foregoing possible implementation, in a fourthpossible implementation of the ninth aspect, the transmit signal of thefirst UE is:

a physical uplink control channel PUCCH signal; or

a physical uplink shared channel PUSCH signal; or

a random access channel RACH; or

a PUCCH signal used to carry a scheduling request SR; or

a PUSCH signal used to carry a buffer status report BSR; or

a communication signal between the first UE and another UE.

With reference to the foregoing possible implementation, in a fifthpossible implementation of the ninth aspect, after the sending theallocated transmission resource to the first UE, the method furtherincludes:

determining whether a resource collision exists between the first UE andthe second UE; and

when confirming that the resource collision exists between the first UEand the second UE, reallocating a transmission resource to the first UEor the second UE.

With reference to the foregoing possible implementation, in a sixthpossible implementation of the ninth aspect, after the sending theallocated transmission resource to the first UE, the method furtherincludes:

sending a resource multiplex message to the first UE and the second UEseparately, where the resource multiplex message is used to notify thatthe same transmission resource is allocated to the first UE and thesecond UE.

With reference to the foregoing possible implementation, in a seventhpossible implementation of the ninth aspect, the determining whether aresource collision exists between the first UE and the second UEincludes:

determining, in real time according to the location information of thefirst UE and location information of the second UE, whether the distancebetween the first UE and the second UE is less than a second presetdistance; and

when confirming that the distance between the first UE and the second UEis less than the second preset distance, determining that the resourcecollision exists between the first UE and the second UE.

With reference to the foregoing possible implementation, in an eighthpossible implementation of the ninth aspect, the determining whether aresource collision exists between the first UE and the second UEincludes:

when receiving a resource collision message sent by the first UE,determining that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thefirst UE by performing detection on the transmission resource at asilent time; or

when receiving a resource collision message sent by the second UE,determining that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thesecond UE by performing detection on the transmission resource at asilent time.

With reference to the foregoing possible implementation, in a ninthpossible implementation of the ninth aspect, before the determiningwhether a resource collision exists between the first UE and the secondUE, the method further includes:

sending silence setting information to the first UE and the second UEseparately, where the silence setting information is used to instructthe UEs to keep silent in a specified transmission timeslot.

With reference to the foregoing possible implementation, in a tenthpossible implementation of the ninth aspect, the determining whether aresource collision exists between the first UE and the second UEincludes:

when receiving a resource collision message sent by third UE,determining that the resource collision exists between the first UE andthe second UE, where the third UE is UE different from the first UE andthe second UE within the coverage of the base station, and the resourcecollision message is obtained by the third UE by performing detection onthe transmission resource.

With reference to the foregoing possible implementation, in an eleventhpossible implementation of the ninth aspect, before the determiningwhether a resource collision exists between the first UE and the secondUE, the method further includes:

sending a broadcast message to the UE within the coverage of the basestation, where the broadcast message carries a transmission resourceindex allocated to the first UE and the second UE, and the transmissionresource index is used by the UE within the coverage of the base stationto perform detection on the transmission resource.

According to a tenth aspect, a resource allocation method is provided,and the method includes:

sending a resource allocation request to a base station;

sending location information of user equipment to the base station, sothat the base station allocates a transmission resource according to thelocation information of the user equipment and location information ofUEs to which transmission resources are currently already allocated; and

receiving the transmission resource allocated by the base station.

With reference to the tenth aspect, in a first possible implementationof the tenth aspect, the sending location information of the userequipment to the base station includes:

sending GPS location information to the base station; or

sending estimated location information to the base station, where theestimated location information is location information obtained by theuser equipment through estimation according to a positioning referencesignal transmitted by the base station; or

sending area index information of an area in which the user equipment iscurrently located to the base station.

With reference to the foregoing possible implementation, in a secondpossible implementation of the tenth aspect, after the receiving thetransmission resource allocated by the base station, the method furtherincludes:

receiving a resource multiplex message sent by the base station; and

periodically sending the location information of the user equipment tothe base station, so that the base station determines, according to thelocation information of the user equipment, whether a resource collisionexists.

With reference to the foregoing possible implementation, in a thirdpossible implementation of the tenth aspect, after the receiving thetransmission resource allocated by the base station, the method furtherincludes:

receiving silence setting information sent by the base station, wherethe silence setting information is used to instruct the UE to keepsilent in a specified transmission timeslot;

keeping silent in the specified transmission timeslot according to thesilence setting information;

when detecting that a detected energy value of the transmission resourceoccupied by the user equipment in the specified transmission timeslot isgreater than a second energy threshold, determining that a resourcecollision exists;

when determining that the resource collision exists, generating aresource collision message; and

sending the resource collision message to the base station.

According to an eleventh aspect, a base station is provided, and thebase station includes a transmitter, a receiver, a memory, and aprocessor that is connected to the transmitter, the receiver, and thememory separately, where

the memory stores a group of program code, and the processor isconfigured to invoke the program code stored in the memory, so that theprocessor is configured to perform the following operations: receiving aresource allocation request sent by first UE, where the first UE is anyUE within coverage of the base station; if the resource allocationrequest carries a transmission resource index obtained by the first UEthrough listening, allocating a transmission resource to the first UEaccording to the transmission resource index; and sending the allocatedtransmission resource to the first UE.

According to a twelfth aspect, user equipment is provided, and the userequipment includes a transmitter, a receiver, a memory, and a processorthat is connected to the transmitter, the receiver, and the memoryseparately, where

the memory stores a group of program code, and the processor isconfigured to invoke the program code stored in the memory, so that theprocessor is configured to perform the following operations: receivinglistening setting information, where the listening setting informationis used to notify the UE of a duration of listening; determining,according to the listening setting information, a duration of listeningto be performed on transmission resources within coverage of a basestation; listening to the transmission resources within the coverage ofthe base station; when a duration of the listening reaches the presetduration, sending a resource allocation request to the base station, sothat the base station allocates a transmission resource according to theresource allocation request; and receiving the transmission resourceallocated by the base station.

According to a thirteenth aspect, user equipment is provided, and theuser equipment includes a transmitter, a receiver, a memory, and aprocessor that is connected to the transmitter, the receiver, and thememory separately, where

the memory stores a group of program code, and the processor isconfigured to invoke the program code stored in the memory, so that theprocessor is configured to perform the following operations: receiving abroadcast message, where the broadcast message carries a transmissionresource index allocated to first UE and second UE; performing detectionon a transmission resource according to the transmission resource index;when determining that a resource collision exists on the transmissionresource, generating a resource collision message; and sending theresource collision message to a base station, so that the base stationdetermines, according to the resource collision message, that theresource collision exists between the first UE and the second UE.

According to a fourteenth aspect, a base station is provided, and thebase station includes a transmitter, a receiver, a memory, and aprocessor that is connected to the transmitter, the receiver, and thememory separately, where

the memory stores a group of program code, and the processor isconfigured to invoke the program code stored in the memory, so that theprocessor is configured to perform the following operations: receiving aresource allocation request from first UE, where the first UE is any UEwithin coverage of the base station; obtaining location information ofthe first UE; determining, according to the location information of thefirst UE and location information of UEs to which transmission resourcesare currently already allocated, second UE that meets a presetcondition, where the preset condition is that a distance between thesecond UE and the first UE is greater than a first preset distance;allocating, to the first UE, a transmission resource already allocatedto the second UE; and sending the allocated transmission resource to thefirst UE.

According to a fifteenth aspect, user equipment is provided, and theuser equipment includes a transmitter, a receiver, a memory, and aprocessor that is connected to the transmitter, the receiver, and thememory separately, where

the memory stores a group of program code, and the processor isconfigured to invoke the program code stored in the memory, so that theprocessor is configured to perform the following operations: sending aresource allocation request to a base station; sending locationinformation of the user equipment to the base station, so that the basestation allocates a transmission resource according to the locationinformation of the user equipment and location information of UEs towhich transmission resources are currently already allocated; andreceiving the transmission resource allocated by the base station.

The technical solutions provided by the embodiments of the presentinvention have the following beneficial effects: The UE listens totransmission resources provided by the base station, and therefore canlearn of a transmission resource in an idle state and actively requestthe idle transmission resource from the base station. Therefore, thebase station can learn, according to a report of the UE, thetransmission resource that the UE can use currently, and can performresource allocation based on the transmission resource reported by theUE. In this way, proper transmission resource allocation is implemented,and a transmission resource multiplex rate and a success rate ofcommunication between vehicles in the Internet of Vehicles areincreased.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention more clearly, the following briefly describes the accompanyingdrawings required for describing the embodiments. Apparently, theaccompanying drawings in the following description show merely someembodiments of the present invention, and a person of ordinary skill inthe art may still derive other drawings from these accompanying drawingswithout creative efforts.

FIG. 1 is a schematic diagram of an implementation scenario used in aresource allocation method according to an embodiment of the presentinvention;

FIG. 2 is a flowchart of a resource allocation method according to anembodiment of the present invention;

FIG. 3 is a flowchart of a resource allocation method according to anembodiment of the present invention;

FIG. 4 is a flowchart of a resource allocation method according to anembodiment of the present invention;

FIG. 5 is a flowchart of a resource allocation method according to anembodiment of the present invention;

FIG. 6 is a flowchart of a resource allocation method according to anembodiment of the present invention;

FIG. 7 is a flowchart of a resource allocation method according to anembodiment of the present invention;

FIG. 8 is a flowchart of a resource allocation method according to anembodiment of the present invention;

FIG. 9 is a flowchart of a resource allocation method according to anembodiment of the present invention;

FIG. 10 is a flowchart of a resource allocation method according to anembodiment of the present invention;

FIG. 11 is a schematic structural diagram of a base station according toan embodiment of the present invention;

FIG. 12 is a schematic structural diagram of user equipment according toan embodiment of the present invention;

FIG. 13 is a schematic structural diagram of user equipment according toan embodiment of the present invention;

FIG. 14 is a schematic structural diagram of a base station according toan embodiment of the present invention;

FIG. 15 is a schematic structural diagram of user equipment according toan embodiment of the present invention;

FIG. 16 is a schematic structural diagram of a base station according toan embodiment of the present invention; and

FIG. 17 is a schematic structural diagram of user equipment according toan embodiment of the present invention.

DESCRIPTION OF EMBODIMENTS

To make the objectives, technical solutions, and advantages of theembodiments of the present invention clearer, the following clearly andcompletely describes the technical solutions in the embodiments of thepresent invention with reference to the accompanying drawings in theembodiments of the present invention. Apparently, the describedembodiments are some but not all of the embodiments of the presentinvention. All other embodiments obtained by a person of ordinary skillin the art based on the embodiments of the present invention withoutcreative efforts shall fall within the protection scope of the presentinvention.

FIG. 1 is a schematic diagram of an implementation scenario used in aresource allocation method according to an embodiment of the presentinvention. As shown in FIG. 1, the implementation scenario includes abase station 101 and at least one UE (User Equipment, user equipment)102. The base station 101 has a radio resource management function, andmay allocate a transmission resource to the UE, so that the UE canperform communication. The UE 102 includes but is not limited to avehicle, a hand-held device in a vehicle, or the like. The UE 102 cannot only communicate with the base station, but also communicate withanother UE by using a transmission resource allocated by the basestation to the UE 102.

FIG. 2 is a flowchart of a resource allocation method according to anembodiment of the present invention. This embodiment may be performed bya base station. Referring to FIG. 2, the method specifically includesthe following steps.

201. Receive a resource allocation request sent by first UE, where thefirst UE is any UE within coverage of a base station.

202. If the resource allocation request carries a transmission resourceindex obtained by the first UE through listening, allocate atransmission resource to the first UE according to the transmissionresource index.

203. Send the allocated transmission resource to the first UE.

In the method provided by this embodiment of the present invention, theUE listens to transmission resources provided by the base station, andtherefore can learn of a transmission resource in an idle state andactively request the idle transmission resource from the base station,so that the base station performs resource allocation based on a reportof the UE. In this way, proper transmission resource allocation isimplemented, and a transmission resource multiplex rate and a successrate of communication between vehicles in the Internet of Vehicles areincreased.

Optionally, before the receiving a resource allocation request sent byfirst UE, the method further includes:

sending listening setting information to the UE within the coverage ofthe base station, where the listening setting information is used tonotify the UE of a duration of listening.

Optionally, the sending listening setting information to the UE withinthe coverage of the base station includes:

sending RRC signaling to the UE within the coverage of the base station,where the RRC signaling carries the listening setting information; or

sending a SIB message to the UE within the coverage of the base station,where the SIB message carries the listening setting information; or

sending control signaling to the UE within the coverage of the basestation, where the control signaling carries the listening settinginformation.

Optionally, before the receiving a resource allocation request sent byfirst UE, the method further includes:

sending energy threshold information to the UE within the coverage ofthe base station, where the energy threshold information is used tonotify the UE of a first energy threshold in listening.

Optionally, the sending energy threshold information to the UE withinthe coverage of the base station includes:

sending RRC signaling to the UE within the coverage of the base station,where the RRC signaling carries the energy threshold information; or

sending a SIB message to the UE within the coverage of the base station,where the SIB message carries the energy threshold information; or

sending control signaling to the UE within the coverage of the basestation, where the control signaling carries the energy thresholdinformation.

Optionally, before the receiving a resource allocation request sent byfirst UE, the method further includes:

sending quantity setting information to the UE within the coverage ofthe base station, where the quantity setting information is used tonotify the UE of a quantity of transmission resource indexes to becarried when the resource allocation request is sent.

Optionally, after the receiving a resource allocation request sent byfirst UE, the method further includes:

if the resource allocation request does not carry any transmissionresource index, allocating a transmission resource to the first UEaccording to an allocation status of the transmission resource of thebase station; and

if the base station has an unallocated transmission resource, allocatingthe unallocated transmission resource to the first UE; or

if all transmission resources of the base station are already allocated,obtaining location information of the first UE;

determining, according to the location information of the first UE andlocation information of UEs to which transmission resources arecurrently already allocated, second UE that meets a preset condition,where the preset condition is that a distance between the second UE andthe first UE is greater than a first preset distance; and

allocating, to the first UE, a transmission resource already allocatedto the second UE.

Optionally, the obtaining location information of the first UE includes:

receiving the location information of the first UE; or

determining the location information of the first UE according to atransmit signal of the first UE; or

using previously obtained location information of the first UE ascurrent location information of the first UE.

Optionally, the receiving the location information sent by the first UEincludes:

receiving GPS location information of the first UE; or receivingestimated location information of the first UE, where the estimatedlocation information is location information obtained by the first UEthrough estimation according to a positioning reference signaltransmitted by the base station; or

receiving area index information of an area in which the first UE iscurrently located.

Optionally, the determining the location information of the first UEaccording to a transmit signal of the first UE includes:

determining a relative azimuth between the first UE and the base stationaccording to the transmit signal of the first UE; and determining adistance between the first UE and the base station according to adetected energy value of the transmit signal of the first UE.

Optionally, the transmit signal of the first UE is:

a physical uplink control channel PUCCH signal; or

the transmit signal of the first UE is a physical uplink shared channelPUSCH signal; or

the transmit signal of the first UE is a RACH; or

the transmit signal of the first UE is a PUCCH signal used to carry anSR; or

the transmit signal of the first UE is a PUSCH signal used to carry aBSR; or

the transmit signal of the first UE is a communication signal betweenthe first UE and another UE.

Optionally, after the sending the allocated transmission resource to thefirst UE, the method further includes:

determining whether a resource collision exists between the first UE andthe second UE; and

when confirming that the resource collision exists between the first UEand the second UE, reallocating a transmission resource to the first UEor the second UE.

Optionally, after the sending the allocated transmission resource to thefirst UE, the method further includes:

sending a resource multiplex message to the first UE and the second UEseparately, where the resource multiplex message is used to notify thatthe same transmission resource is allocated to the first UE and thesecond UE.

Optionally, the determining whether a resource collision exists betweenthe first UE and the second UE includes:

determining, in real time according to the location information of thefirst UE and location information of the second UE, whether the distancebetween the first UE and the second UE is less than a second presetdistance; and

when confirming that the distance between the first UE and the second UEis less than the second preset distance, determining that the resourcecollision exists between the first UE and the second UE.

Optionally, the determining whether a resource collision exists betweenthe first UE and the second UE includes:

when receiving a resource collision message sent by the first UE,determining that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thefirst UE by performing detection on the transmission resource at asilent time; or

when receiving a resource collision message sent by the second UE,determining that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thesecond UE by performing detection on the transmission resource at asilent time.

Optionally, before the determining whether a resource collision existsbetween the first UE and the second UE, the method further includes:

sending silence setting information to the first UE and the second UEseparately, where the silence setting information is used to instructthe UEs to keep silent in a specified transmission timeslot.

Optionally, the determining whether a resource collision exists betweenthe first UE and the second UE includes:

when receiving a resource collision message sent by third UE,determining that the resource collision exists between the first UE andthe second UE, where the third UE is UE different from the first UE andthe second UE within the coverage of the base station, and the resourcecollision message is obtained by the third UE by performing detection onthe transmission resource.

Optionally, before the determining whether a resource collision existsbetween the first UE and the second UE, the method further includes:

sending a broadcast message to the UE within the coverage of the basestation, where the broadcast message carries a transmission resourceindex allocated to the first UE and the second UE, and the transmissionresource index is used by the UE within the coverage of the base stationto perform detection on the transmission resource.

All the foregoing optional technical solutions may be randomly combinedto form optional embodiments of the present invention. Details are notdescribed exhaustively herein.

FIG. 3 is a flowchart of a resource allocation method according to anembodiment of the present invention. This embodiment may be performed byUE. Referring to FIG. 3, the method includes the following steps.

301. Receive listening setting information, where the listening settinginformation is used to notify UE of a duration of listening.

302. Determine, according to the listening setting information, aduration of listening to be performed on transmission resources withincoverage of a base station.

303. Listen to the transmission resources within the coverage of thebase station.

304. When a duration of the listening reaches the preset duration, senda resource allocation request to the base station, so that the basestation allocates a transmission resource according to the resourceallocation request.

305. Receive the transmission resource allocated by the base station.

Optionally, the listening to the transmission resources within thecoverage of the base station includes:

performing energy detection on the transmission resource to obtain adetected energy value; and

when the detected energy value is less than a first energy threshold,obtaining a transmission resource index of the transmission resource.

Optionally, the resource allocation request carries the transmissionresource index of the transmission resource.

Optionally, before the listening to the transmission resources withinthe coverage of the base station, the method further includes:

receiving energy threshold information from the base station, where theenergy threshold information is used to notify the UE of the firstenergy threshold in listening.

Optionally, before the sending a resource allocation request to the basestation when a duration of the listening reaches the preset duration,the method further includes:

receiving quantity setting information sent by the base station, wherethe quantity setting information is used to notify the UE of a quantityof transmission resource indexes to be carried when the resourceallocation request is sent; and

determining, according to the quantity setting request, the quantity oftransmission resource indexes to be carried in the resource allocationrequest.

Optionally, the method further includes: when determining that notransmission resource that is listened to is idle, sending locationinformation of the user equipment to the base station.

Optionally, the sending location information of the user equipment tothe base station includes:

sending GPS location information to the base station; or

sending estimated location information to the base station, where theestimated location information is location information obtained by theuser equipment through estimation according to a positioning referencesignal transmitted by the base station; or

sending area index information of an area in which the user equipment iscurrently located to the base station.

Optionally, after the receiving the transmission resource allocated bythe base station, the method further includes:

receiving a resource multiplex message sent by the base station; and

periodically sending location information of the user equipment to thebase station, so that the base station determines, according to thelocation information of the user equipment, whether a resource collisionexists.

Optionally, after the receiving the transmission resource allocated bythe base station, the method further includes:

receiving silence setting information sent by the base station, wherethe silence setting information is used to instruct the UE to keepsilent in a specified transmission timeslot;

keeping silent in the specified transmission timeslot according to thesilence setting information;

when detecting that a detected energy value of the transmission resourceoccupied by the user equipment in the specified transmission timeslot isgreater than a second energy threshold, determining that a resourcecollision exists;

when determining that the resource collision exists, generating aresource collision message; and

sending the resource collision message to the base station.

All the foregoing optional technical solutions may be randomly combinedto form optional embodiments of the present invention. Details are notdescribed exhaustively herein.

FIG. 4 is a flowchart of a resource allocation method according to anembodiment of the present invention. This embodiment is performed by UE.Referring to FIG. 4, the method includes the following steps.

401. Receive a broadcast message, where the broadcast message carries atransmission resource index allocated to first UE and second UE.

402. Perform detection on a transmission resource according to thetransmission resource index.

403. When determining that a resource collision exists on thetransmission resource, generate a resource collision message.

404. Send the resource collision message to a base station, so that thebase station determines, according to the resource collision message,that the resource collision exists between the first UE and the secondUE.

Optionally, the performing detection on a transmission resourceaccording to the transmission resource index includes:

performing detection on the transmission resource corresponding to thetransmission resource index; and

if a signal is successfully detected on the transmission resource, butas the user equipment moves, a change range of signal energy on thetransmission resource is less than a preset threshold, and no signal canbe successfully detected on the transmission resource again, and stillno signal can be successfully detected within a preset duration,determining that the resource collision exists between the first UE andthe second UE.

All the foregoing optional technical solutions may be randomly combinedto form optional embodiments of the present invention. Details are notdescribed exhaustively herein.

FIG. 5 is a flowchart of a resource allocation method according to anembodiment of the present invention. Referring to FIG. 5, the methodincludes the following steps.

501. Receive a resource allocation request from first UE, where thefirst UE is any UE within coverage of a base station.

502. Obtain location information of the first UE.

503. Determine, according to the location information of the first UEand location information of UEs to which transmission resources arecurrently already allocated, second UE that meets a preset condition,where the preset condition is that a distance between the second UE andthe first UE is greater than a first preset distance.

504. Allocate, to the first UE, a transmission resource alreadyallocated to the second UE.

505. Send the allocated transmission resource to the first UE.

Optionally, the obtaining location information of the first UE includes:

receiving the location information of the first UE; or

determining the location information of the first UE according to atransmit signal of the first UE; or

using previously obtained location information of the first UE ascurrent location information of the first UE.

Optionally, the receiving the location information sent by the first UEincludes:

receiving GPS location information of the first UE; or

receiving estimated location information of the first UE, where theestimated location information is location information obtained by thefirst UE through estimation according to a positioning reference signaltransmitted by the base station; or

receiving area index information of an area in which the first UE iscurrently located.

Optionally, the determining the location information of the first UEaccording to a transmit signal of the first UE includes:

determining a relative azimuth between the first UE and the base stationaccording to the transmit signal of the first UE; and

determining a distance between the first UE and the base stationaccording to a detected energy value of the transmit signal of the firstUE.

Optionally, the transmit signal of the first UE is:

a physical uplink control channel PUCCH signal; or

a physical uplink shared channel PUSCH signal; or

a random access channel RACH; or

a PUCCH signal used to carry a scheduling request SR; or

a PUSCH signal used to carry a buffer status report BSR; or

a communication signal between the first UE and another UE.

Optionally, after the sending the allocated transmission resource to thefirst UE, the method further includes:

determining whether a resource collision exists between the first UE andthe second UE; and

when confirming that the resource collision exists between the first UEand the second UE, reallocating a transmission resource to the first UEor the second UE.

Optionally, after the sending the allocated transmission resource to thefirst UE, the method further includes:

sending a resource multiplex message to the first UE and the second UEseparately, where the resource multiplex message is used to notify thatthe same transmission resource is allocated to the first UE and thesecond UE.

Optionally, the determining whether a resource collision exists betweenthe first UE and the second UE includes:

determining, in real time according to the location information of thefirst UE and location information of the second UE, whether the distancebetween the first UE and the second UE is less than a second presetdistance; and

when confirming that the distance between the first UE and the second UEis less than the second preset distance, determining that the resourcecollision exists between the first UE and the second UE.

Optionally, the determining whether a resource collision exists betweenthe first UE and the second UE includes:

when receiving a resource collision message sent by the first UE,determining that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thefirst UE by performing detection on the transmission resource at asilent time; or

when receiving a resource collision message sent by the second UE,determining that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thesecond UE by performing detection on the transmission resource at asilent time.

Optionally, before the determining whether a resource collision existsbetween the first UE and the second UE, the method further includes:

sending silence setting information to the first UE and the second UEseparately, where the silence setting information is used to instructthe UEs to keep silent in a specified transmission timeslot.

Optionally, the determining whether a resource collision exists betweenthe first UE and the second UE includes:

when receiving a resource collision message sent by third UE,determining that the resource collision exists between the first UE andthe second UE, where the third UE is UE different from the first UE andthe second UE within the coverage of the base station, and the resourcecollision message is obtained by the third UE by performing detection onthe transmission resource.

Optionally, before the determining whether a resource collision existsbetween the first UE and the second UE, the method further includes:

sending a broadcast message to the UE within the coverage of the basestation, where the broadcast message carries a transmission resourceindex allocated to the first UE and the second UE, and the transmissionresource index is used by the UE within the coverage of the base stationto perform detection on the transmission resource.

All the foregoing optional technical solutions may be randomly combinedto form optional embodiments of the present invention. Details are notdescribed exhaustively herein.

FIG. 6 is a flowchart of a resource allocation method according to anembodiment of the present invention. Referring to FIG. 6, the methodincludes the following steps.

601. Send a resource allocation request to a base station.

602. Send location information of user equipment to the base station, sothat the base station allocates a transmission resource according to thelocation information of the user equipment and location information ofUEs to which transmission resources are currently already allocated.

603. Receive the transmission resource allocated by the base station.

Optionally, the sending location information of user equipment to thebase station includes:

sending GPS location information to the base station; or

sending estimated location information to the base station, where theestimated location information is location information obtained by theuser equipment through estimation according to a positioning referencesignal transmitted by the base station; or

sending area index information of an area in which the user equipment iscurrently located to the base station.

Optionally, after the receiving the transmission resource allocated bythe base station, the method further includes:

receiving a resource multiplex message sent by the base station; and

periodically sending the location information of the user equipment tothe base station, so that the base station determines, according to thelocation information of the user equipment, whether a resource collisionexists.

Optionally, after the receiving the transmission resource allocated bythe base station, the method further includes:

receiving silence setting information sent by the base station, wherethe silence setting information is used to instruct the UE to keepsilent in a specified transmission timeslot;

keeping silent in the specified transmission timeslot according to thesilence setting information;

when detecting that a detected energy value of the transmission resourceoccupied by the user equipment in the specified transmission timeslot isgreater than a second energy threshold, determining that a resourcecollision exists;

when determining that the resource collision exists, generating aresource collision message; and

sending the resource collision message to the base station.

All the foregoing optional technical solutions may be randomly combinedto form optional embodiments of the present invention. Details are notdescribed exhaustively herein.

With reference to the schematic diagram of the implementation scenarioshown in FIG. 1 and content in the foregoing embodiments, FIG. 7 is aflowchart of a resource allocation method according to an embodiment ofthe present invention. Referring to FIG. 7, the method includes thefollowing steps.

701. A base station sends listening setting information to UE withincoverage of the base station, where the listening setting information isused to notify the UE of a duration of listening.

Optionally, due to mobility of the UE and possible instability of acommunication signal between the UE and the base station, the UE may notsuccessfully receive the listening setting information sent by the basestation. Therefore, in an optional implementation of this embodiment ofthe present invention, to ensure that all UEs within the coverage of thebase station can successfully receive the listening setting request sentby the base station, the base station may set a transmission period, andperiodically send the listening setting information to the UEs withinthe coverage of the base station, so that all the UEs within thecoverage of the base station can receive the listening settinginformation.

The listening setting information may be sent in multiple forms, forexample, may be sent by using RRC (Radio Resource Control, radioresource control protocol) signaling, a SIB (System Information Block,system information block) message, or control signaling. Specifically,the sending process may include: the base station sends RRC signaling tothe UE within the coverage of the base station, where the RRC signalingcarries the listening setting information; or the base station sends aSIB message to the UE within the coverage of the base station, where theSIB message carries the listening mode information; or the base stationsends control signaling to the UE within the coverage of the basestation, where the control signaling carries the listening settinginformation.

702. First UE receives the listening setting information sent by thebase station.

This embodiment of the present invention is described by using anexample in which the duration of listening is set by the base station.In an actual scenario, the duration of listening not only may be set bythe base station, but also may be a duration predefined on the userequipment. The predefined duration may be a fixed value specified on thefirst UE by a manufacturer before the first UE is delivered. Certainly,the duration may also be set by a user. The UE may provide a function ofsetting the duration by the user, and the user enters the presetduration on the UE. For example, the user may enter 10 ms, 20 ms, or thelike. This is not limited in this embodiment of the present invention.When the UE detects the duration entered by the user, the UE sets theduration entered by the user as a duration of listening to atransmission resource.

In this embodiment of the present invention, different durations oflistening may be set according to requirements of the UE oncommunication quality. For example, when the UE has a large amount ofdata to be transmitted and requires a large quantity of idletransmission resources, the duration may be set to a larger value, sothat the UE listens to transmission resources for a longer time, andfurther obtains more idle transmission resources through listening. Whenthe UE has no special requirement on the quantity of idle transmissionresources that are listened to or the UE has a high requirement ontimeliness of transmission, the duration may also be set to a smallervalue, so that the listening can be completed in time and that thetransmission resources can be obtained as soon as possible.

703. The first UE determines, according to the listening settinginformation, a duration of listening to be performed on transmissionresources within the coverage of the base station.

When the first UE receives the listening setting request sent by thebase station, the duration carried in the listening setting request isused as the duration of listening to be performed by the first UE on thetransmission resources.

704. The first UE listens to the transmission resources within thecoverage of the base station.

In this embodiment of the present invention, the listening may beperforming energy detection on a transmission resource. If acommunication signal of UE exists on the transmission resource, and theUE is close to the first UE, a detected energy value of the transmissionresource is relatively large. When no communication signal of UE existson the transmission resource, or a communication signal of UE exists onthe transmission resource and the UE is far away from the first UE, adetected energy value of the transmission resource is relatively small.Therefore, in this embodiment of the present invention, energy detectionis performed on the transmission resource, and whether the transmissionresource is idle is determined, according to the detected energy value.Specifically, that the first UE listens to the transmission resourceswithin the coverage of the base station includes: the first UE performsenergy detection on a transmission resource to obtain a detected energyvalue; when the detected energy value is less than a first energythreshold, the transmission resource is considered as idle, and thefirst UE obtains a transmission resource index of the idle transmissionresource; and when a duration of listening to the transmission resourceby the first UE reaches the preset duration, the first UE stopslistening to the transmission resource.

The first energy threshold may be set by the base station. In this case,before step 704, the method may further include: the base station sendsenergy threshold information to the UE within the coverage of the basestation, where the energy threshold information is used to notify the UEof the first energy threshold in listening. When the UE receives theenergy threshold information, the UE sets the user equipment itselfaccording to the first energy threshold. Certainly, in an actualscenario, the first energy threshold not only may be set by the basestation, but also may be a first energy threshold predefined on the userequipment. A source of the first energy threshold is not specificallylimited in this embodiment of the present invention.

It should be noted that, the energy threshold information may be sent inmultiple forms, for example, may be sent by using RRC signaling, a SIBmessage, or control signaling. Specifically, the sending process mayinclude: sending RRC signaling to the UE within the coverage of the basestation, where the RRC signaling carries the energy thresholdinformation; or sending a SIB message to the UE within the coverage ofthe base station, where the SIB message carries the energy thresholdinformation; or sending control signaling to the UE within the coverageof the base station, where the control signaling carries the energythreshold information.

Because there may be multiple transmission resources within the coverageof the base station, in an actual listening process, a poll manner maybe used to listen to different transmission resources, or a parallelmanner may be used to listen to different transmission resources.

705. The first UE obtains an idle transmission resource index throughlistening.

The idle transmission resource index is used to identify an idletransmission resource obtained by the first UE through listening. Thisembodiment of the present invention is described by using an example inwhich an idle transmission resource is obtained through listening.However, in an actual scenario, the first UE possibly cannot obtain anyidle transmission resource through listening, and therefore cannotobtain any idle transmission resource index. In this case, a resourceallocation request sent to the base station may not carry anytransmission resource index, so that the base station learns a currentrequirement of the first UE.

Further, multiple idle transmission resources may be obtained by thefirst UE through listening. In this case, to avoid resource waste andreduce signaling load, the base station may further send quantitysetting information to the UE within the coverage of the base station,where the quantity setting information is used to notify the UE of aquantity of transmission resource indexes to be carried when theresource allocation request is sent. When the UE receives the quantitysetting information, the UE sets, according to the quantity carried inthe quantity setting information, a quantity of transmission resourceindexes to be carried when the resource allocation request is sent.

Specifically, when the quantity of idle transmission resources that areobtained by the first UE through listening is greater than the quantityof transmission resource indexes carried in the quantity settinginformation, the resource allocation request carries the quantityspecified in the quantity setting information. When the quantity of idletransmission resources that are obtained by the first UE throughlistening is less than the quantity of transmission resource indexescarried in the quantity setting information, the resource allocationrequest carries all idle transmission resource indexes that are obtainedby the UE through listening. For example, when the quantity of idletransmission resources that are obtained by the first UE throughlistening is 8, and the quantity of transmission resource indexescarried in the quantity setting information is 5, the resourceallocation request carries five transmission resource indexes; when thequantity of idle transmission resources that are obtained by the firstUE through listening is 8, and the quantity of transmission resourceindexes carried in the quantity setting information is 10, the resourceallocation request carries eight transmission resource indexes.

In addition, when the first UE obtains the idle transmission resourcesthrough listening, in another embodiment of the present invention, theidle transmission resource indexes may be further sorted in ascendingorder of detected energy values of the idle transmission resources, andthe resource allocation request carries sorted idle transmissionresource indexes. Certainly, when the quantity of idle transmissionresources that are obtained by the first UE through listening is greaterthan the quantity of transmission resource indexes carried in thequantity setting information, a quantity of idle transmission resourceindexes equal to the quantity of transmission resource indexes carriedin the quantity setting information may be obtained according to asequence of sorted detected energy values. Due to factors such as adistance between UEs, an idle transmission resource obtained by the UEthrough listening is not always actually idle; instead, when a detectedenergy value is smaller, a possibility that the transmission resource isan idle resource is higher. Therefore, an idle transmission resourcewith a smaller detected energy value is reported to the base station, sothat the base station performs resource allocation for the first UE.This can increase an allocation success rate greatly.

706. When a duration of the listening reaches the preset duration, thefirst UE sends a resource allocation request to the base station, wherethe resource allocation request carries the idle transmission resourceindex obtained by the first UE through listening.

This embodiment of the present invention is described by using anexample in which the resource allocation request carries the idletransmission resource index obtained by the first UE through listening.

707. The base station receives the resource allocation request sent bythe first UE.

708. If the resource allocation request carries the transmissionresource index obtained by the first UE through listening, the basestation allocates a transmission resource to the first UE according tothe transmission resource index.

The transmission resource corresponding to the transmission resourceindex may be an idle transmission resource or a transmission resourcethat is already allocated. If the transmission resource is alreadyallocated, because there is a long distance between UE that is allocatedthe transmission resource and the first UE, communication thereof is notmutually affected. Therefore, the transmission resource corresponding tothe transmission resource index may be directly allocated to the firstUE.

709. The base station sends the allocated transmission resource to thefirst UE.

710. The first UE receives the transmission resource allocated by thebase station, and performs communication based on the allocatedtransmission resource.

Based on the allocated transmission resource, the first UE may send avehicle-to-vehicle communication signal to another UE or send a signalto the base station. This process is not specifically limited in thisembodiment of the present invention.

In the method provided by this embodiment of the present invention, theUE listens to transmission resources provided by the base station, andtherefore can learn of a transmission resource in an idle state andactively request the idle transmission resource from the base station,so that the base station performs resource allocation based on a reportof the UE. In this way, proper transmission resource allocation isimplemented, and a transmission resource multiplex rate and a successrate of communication between vehicles in the Internet of Vehicles areincreased.

The foregoing embodiment shown in FIG. 7 is described by using anexample in which the first UE obtains an idle transmission resourcethrough listening. However, in an actual scenario, the first UE possiblycannot obtain any idle transmission resource through listening. Toimplement vehicle-to-vehicle communication and increase a resourcemultiplex rate, an embodiment of the present invention further providesanother possible implementation. Referring to FIG. 8, the implementationspecifically includes the following steps.

801. A base station sends listening setting information to UE withincoverage of the base station, where the listening setting information isused to notify the UE of a duration of listening.

802. First UE receives the listening setting information sent by thebase station.

803. The first UE determines, according to the listening settinginformation, a duration of listening to be performed on transmissionresources within the coverage of the base station.

804. The first UE listens to the transmission resources within thecoverage of the base station.

The foregoing steps 801 to 804 are the same as steps 701 to 704, and arenot described again herein.

805. The first UE does not obtain any idle transmission resource indexthrough listening.

806. When a duration of the listening reaches the preset duration, thefirst UE sends a resource allocation request to the base station, wherethe resource allocation request does not carry any transmission resourceindex.

807. The base station receives the resource allocation request sent bythe first UE.

808. If the resource allocation request does not carry any transmissionresource index, allocate a transmission resource to the first UEaccording to an allocation status of the transmission resource of thebase station.

Specifically, the process includes steps 808A to 808E.

808A. Determine whether the base station has any unallocatedtransmission resource, and if yes, perform step 808B, or if not, performstep 808C.

The base station stores allocation statuses of transmission resourcesaccording to resource allocation of the base station, for example, whichtransmission resource is already allocated and which UE is allocated thetransmission resource. Therefore, the base station may learn, byquerying the allocation statuses of the transmission resources of thebase station, whether the base station currently has any transmissionresource that may be allocated.

808B. If the base station has an unallocated transmission resource,allocate the unallocated transmission resource to the first UE.

In this embodiment of the present invention, the base station mayrandomly allocate any unallocated transmission resource to the first UEaccording to a transmission resource index carried in the resourceallocation request. A manner of allocating a transmission resource tothe first UE by the base station is not limited in this embodiment ofthe present invention.

808C. If all transmission resources of the base station are alreadyallocated, obtain location information of the first UE.

The obtaining location information of the first UE in step 808C may beimplemented in any one of the following three possible implementations:

First possible implementation: receiving the location information of thefirst UE.

Specifically, the receiving the location information of the first UE mayinclude three possible implementations: (1) Receiving GPS locationinformation of the first UE. UE equipped with a GPS positioning systemmay obtain GPS location information by using the GPS positioning systemconfigured for the UE, and send the GPS location information to the basestation, so that the base station receives the GPS location informationof the UE. (2) Receiving estimated location information of the first UE,where the estimated location information is location informationobtained by the first UE through estimation according to a positioningreference signal transmitted by the base station. Some UEs that are notequipped with a positioning system may estimate location information ofthe UEs according to positioning reference signals received by the UEsto obtain estimated location information, and send the estimatedlocation information to the base station, so that the base stationreceives the estimated location information of the UEs. (3) Receivingcurrent area index information of the first UE. In an actual scenario, amanner of reporting a location implicitly may also be used. For example,the base station divides the coverage of the base station into multipleareas according to geographical locations, and the areas correspond todifferent area index information. A terminal in an area can determine,according to a current status of the terminal, such as locationinformation (GPS location information or estimated location informationor the like) of the terminal, the area in which the terminal is located,and therefore send area index information of the corresponding area tothe base station, so that after the base station receives the area indexinformation, the base station determines current location information ofthe UE according to an area index.

Second possible implementation: determining the location information ofthe first UE according to a transmit signal of the first UE.

In this embodiment of the present invention, the transmit signal of thefirst UE may be an SRS (Sounding Reference Signal, sounding referencesignal), a RACH (Random Access Channel, random access channel), a PUCCH(Physical Uplink Control Channel, physical uplink control channel), aPUSCH (Physical Uplink Share Channel, physical uplink shared channel), aphysical uplink control channel PUCCH signal used to carry an SR(Scheduling Request, scheduling request), a physical uplink sharedchannel PUSCH channel used to carry a BSR (Buffer Status Report, bufferstatus report), or a communication signal between the first UE andanother UE. If currently there is service transmission between the firstUE and the base station, the location information of the first UE may bedetermined according to the PUCCH signal, the PUSCH signal, the SRSsignal, or the like. However, if the first UE requests a resource forvehicle-to-vehicle communication by using the SR request in this case,the location information of the first UE may be determined by using thephysical uplink control channel PUCCH signal used to carry the SR, thephysical uplink shared channel PUSCH channel used to carry the BSR, orthe like. However, if the base station can receive a communicationsignal in vehicle-to-vehicle communication, the location information ofthe first UE may be determined by using the communication signal betweenthe first UE and the another UE.

Specifically, the second possible implementation includes: determining arelative azimuth between the first UE and the base station according tothe transmit signal of the first UE; and determining a distance betweenthe first UE and the base station according to a detected energy valueof the transmit signal of the first UE. Specifically, the base stationmay determine the relative azimuth between the first UE and the basestation according to the transmit signal of the first UE, for example,determine, according to the transmit signal of the first UE, that thefirst UE is on an east side of the base station. The base stationdetermines the distance between the first UE and the base stationaccording to the detected energy value of the transmit signal of thefirst UE. For example, the base station determines, according to thedetected energy value of the transmit signal of the first UE, that thefirst UE is 500 meters away from the base station. The locationinformation of the first UE is determined according to the relativeazimuth between the first UE and the base station and the distancebetween the first UE and the base station that are determined by thebase station.

In a vehicle-to-vehicle communication process, the UE may send statusinformation of the UE to another UE, and the status information mayinclude information such as a location, a driving direction, and adriving speed of a vehicle. However, because a broadcast form is usedfor transmission in vehicle-to-vehicle communication, the base stationmay also successfully receive a communication signal invehicle-to-vehicle communication, and parse the communication signal todetermine the location information of the UE.

Third possible implementation: using previously obtained locationinformation of the first UE as current location information of the firstUE.

Certainly, to save computing resources, the previously obtained locationinformation of the first UE may also be obtained and used as the currentlocation information of the first UE.

808D. Determine, according to the location information of the first UEand location information of UEs to which transmission resources arecurrently already allocated, second UE that meets a preset condition,where the preset condition is that a distance between the second UE andthe first UE is greater than a first preset distance.

808E. Allocate, to the first UE, a transmission resource alreadyallocated to the second UE.

A method for obtaining the location information of the other UEs may bethe same as the method for obtaining the location information of thefirst UE, and is not described again herein.

To increase a resource multiplex rate while ensuring communicationquality, during resource allocation, a search for the second UEaccording to the obtained location information of the first UE may beperformed among the UEs to which transmission resources are currentlyalready allocated. When a distance between UEs is greater than the firstpreset distance, impact on communication quality of the UEs isminimized. Therefore, the transmission resource allocated to the secondUE may be allocated to the first UE. The first preset distance may bepreset by the base station. For example, when a transmission distance invehicle-to-vehicle communication is 300 meters, the base station mayallocate, according to location information of UEs, a same transmissionresource to two UEs that are 600 meters away from each other, where thedistance is at least twice the vehicle-to-vehicle transmission distance.In this case, problems such as a transmission collision and a hiddennode do not exist between the two vehicles.

809. The base station sends the allocated transmission resource to thefirst UE.

810. The first UE receives the transmission resource allocated by thebase station, and performs communication based on the allocatedtransmission resource.

The steps 809 and 810 are the same as steps 709 and 710, and are notdescribed again herein.

In the method provided by this embodiment of the present invention, theUE listens to transmission resources provided by the base station, andtherefore can learn of a transmission resource in an idle state andactively request the idle transmission resource from the base station,so that the base station performs resource allocation based on a reportof the UE. In this way, proper transmission resource allocation isimplemented, and a transmission resource multiplex rate and a successrate of communication between vehicles in the Internet of Vehicles areincreased. Further, even if the resource obtained through listening isnot an actually idle transmission resource, resource allocation may bestill performed, according to a distance between UEs, for the UE thatcurrently requests the resource. Therefore, the transmission resourcemultiplex rate is increased without affecting communication of anotherUE.

The embodiments shown in FIG. 7 and FIG. 8 are described by using anexample in which the first UE performs listening. However, in an actualscenario, a listening process may also not be started; instead, resourceallocation is performed for the first UE directly based on the locationinformation of the first UE. Correspondingly, an embodiment of thepresent invention further provides another possible implementation.Referring to FIG. 9, the implementation specifically includes thefollowing steps.

901. First UE sends a resource allocation request to a base station,where the resource allocation request does not carry any transmissionresource index.

This embodiment of the present invention is described by using anexample in which the UE does not perform a listening process.

902. The base station receives the resource allocation request sent bythe first UE.

903. The base station determines whether there is any unallocatedtransmission resource, and if no, performs step 904.

In another implementation of this embodiment of the present invention,if the base station has an unallocated transmission resource, theunallocated transmission resource is allocated to the first UE.

904. The base station obtains location information of the first UE.

When the resource allocation request does not carry any transmissionresource index, it indicates that the first UE does not perform resourcelistening, or performs resource listening but does not obtain any idletransmission resource through listening. In this case, to ensure acommunication success rate of the first UE and increase a resourcemultiplex rate, resource allocation may be performed for the first UEaccording to the location information of the first UE.

The process of obtaining the location information of the first UE is thesame as the foregoing step 808C, and is not described again herein.

905. Determine, according to the location information of the first UEand location information of UEs to which transmission resources arecurrently already allocated, second UE that meets a preset condition,where the preset condition is that a distance between the second UE andthe first UE is greater than a first preset distance; and allocate, tothe first UE, a transmission resource already allocated to the secondUE.

That the base station allocates a transmission resource to the first UEincludes two cases. In the first case, the base station has an idletransmission resource, and the base station allocates the available idleresource to the first UE. In the second case, all transmission resourcesof the base station are occupied, and the base station allocates, to thefirst UE according to the location information of the first UE and thelocation information of the UEs to which transmission resources arecurrently already allocated, the transmission resource already allocatedto the second UE, where the distance between the second UE and the firstUE is greater than the first preset distance.

The step 905 is the same as step 808D, and is not described againherein.

906. The base station sends the allocated transmission resource to thefirst UE.

907. The first UE receives the transmission resource allocated by thebase station, and performs communication based on the allocatedtransmission resource.

The steps 906 and 907 are the same as steps 709 and 710, and are notdescribed again herein.

In the method provided by this embodiment of the present invention, adistance between UEs is determined according to location information ofthe UEs. Therefore, a same transmission resource may be allocated to UEsthat have a distance greater than the first preset distance. Therefore,resource multiplex is implemented, and a transmission resource multiplexrate is increased without affecting communication between UEs.

Further, the foregoing embodiments shown in FIG. 8 to FIG. 10 are alldescribed by using an example about how to allocate a transmissionresource, but after multiplex of the transmission resource, acommunication success rate needs to be further increased, that is, aresource collision needs to be avoided. Therefore, on a basis of theforegoing embodiments, that is, on a basis of allocating the sametransmission resource to the first UE and the second UE, an embodimentof the present invention further provides a collision detection method.Referring to FIG. 10, the collision detection method includes thefollowing steps.

1001. A base station sends a resource multiplex message to first UE andsecond UE separately, where the resource multiplex message is used tonotify that a same transmission resource is allocated to the first UEand the second UE.

The base station may trigger, by sending the resource multiplex message,the first UE and the second UE to periodically send their locationinformation to the base station, so that the base station determines,according to the location information of the first UE and the second UE,whether a resource collision exists.

1002. When receiving the resource multiplex message sent by the basestation, the first UE and the second UE send their location informationto the base station periodically.

The sending process may be the same as sending the location informationof the UE by the UE, and is not described again herein.

1003. The base station determines, in real time according to thelocation information of the first UE and the second UE, whether adistance between the first UE and the second UE is less than a secondpreset distance, and if yes, performs step 1004, or if no, continues toperform a step of obtaining location information and determining. Thesecond preset distance may be set by the base station.

1004. When confirming that the distance between the first UE and thesecond UE is less than the second preset distance, the base stationdetermines that a resource collision exists between the first UE and thesecond UE.

The second preset distance is less than or equal to a first presetdistance. When the distance between the UEs is less than the secondpreset distance, it may be considered that communication quality of theUEs is affected. In this case, it may be determined that the resourcecollision exists between the first UE and the second UE.

The foregoing steps 1001 and 1002 are described by using an example inwhich the base station determines, according to the location informationsent by the first UE and the second UE, whether the resource collisionexists. In an actual scenario, the present invention further providestwo other possible implementations for determining whether the resourcecollision exists:

First possible implementation: when receiving a resource collisionmessage sent by the first UE, determining that the resource collisionexists between the first UE and the second UE, where the resourcecollision message is obtained by the first UE by performing detection onthe transmission resource at a silent time.

It should be noted that, the UE may keep silent in a communicationprocess according to a preset silent manner. Silence means that in atransmission timeslot, the UE does not send a signal or data, butreceives a signal or data only. In this case, in a silent state, the UEmay confirm, by listening to the transmission resource, whether thetransmission resource is occupied. The preset silent manner may be setby the base station, predefined on the user equipment, or set by theuser equipment. For example, the base station may send silence settinginformation to the first UE and the second UE separately, where thesilence setting information is used to instruct the UEs to keep silentin a specified transmission timeslot. For example, the silence settinginformation may be used to instruct the UEs to keep silent in one offive transmission opportunities, and perform energy detection on theallocated transmission resource in the silent resource.

After the first UE or the second UE determines the silent manner, whendetecting that a detected energy value of the allocated transmissionresource in the specified transmission timeslot is greater than a secondenergy threshold, the first UE or the second UE determines that theresource collision exists on the transmission resource and generates aresource collision message. When generating the resource collisionmessage, the first UE or the second UE sends the resource collisionmessage to the base station, so that the base station determines,according to the resource collision message, that the resource collisionexists between the first UE and the second UE. The second energythreshold may be set by the base station. In this case, before step1004, the method may further include: the base station sends energythreshold information to UE within coverage of the base station, wherethe energy threshold information is used to notify the UE of a secondenergy threshold in listening. When the UE receives the energy thresholdinformation, the UE sets the UE itself according to the second energythreshold. Certainly, in an actual scenario, the second energy thresholdnot only may be set by the base station, but also may be a second energythreshold predefined on the user equipment. A source of the secondenergy threshold is not specifically limited in this embodiment of thepresent invention.

To improve precision of silence detection, the first UE and the secondUE may use different silent manners, so that the first UE and the secondUE keep silent in different transmission timeslots. This prevents thesecond UE (or the first UE) from being silent in the transmissiontimeslot when the first UE (or the second UE) keeps silent in thespecified transmission timeslot. Otherwise, the first UE detects thatthe detected energy value of the occupied transmission resourced is lessthan the second energy threshold, and therefore, wrong determining iscaused.

The base station may send different silence setting information todifferent UEs according to IDs (Identity, identity) of the UEs oridentities of cells accessed by the UEs. The silence setting informationmay be random. For example, the silence setting information sent to thefirst UE is used to instruct the first UE to keep silent in a fifthtransmission timeslot in every ten transmission timeslots, and thesilence setting information sent to the second UE is used to instructthe second UE to keep silent in an eighth transmission timeslot in everyten transmission timeslots. Certainly, the silence setting informationmay also comply with a principle. For example, numbers of silenttransmission timeslots increase in sequence. For example, the silencesetting information sent to the first UE is used to instruct the firstUE to keep silent in a first transmission timeslot in every tentransmission timeslots, and the silence setting information sent to thesecond UE is used to instruct the second UE to keep silent in a secondtransmission timeslot in every ten transmission timeslots. Differentsilence setting information is sent to different UEs, so that the firstUE and the second UE use different silent manners. Certainly, the firstUE may also set, on the first UE itself, a silence mechanism differentfrom that on the second UE. Manners of determining different silencemechanisms by the first UE and the second UE are not limited in thisembodiment of the present invention.

Certainly, the resource collision message in the foregoing process issent by the first UE. In an actual scenario, the second UE performsdetection on the transmission resource at a silent time, and may alsodetect that the transmission resource is already occupied by another UE.In this case, the second UE may also send a resource collision messageto the base station. That is, when the base station receives theresource collision message sent by the second UE, the base stationdetermines that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thesecond UE by performing detection on the transmission resource at thesilent time.

Second manner: when receiving a resource collision message sent by thirdUE, determining that the resource collision exists between the first UEand the second UE, where the third UE is UE different from the first UEand the second UE within the coverage of the base station, and theresource collision message is obtained by the third UE by performingdetection on the transmission resource.

To learn of the resource collision in time, the base station may send abroadcast message to the UE within the coverage of the base station,where the broadcast message carries the transmission resource index, sothat the UE within the coverage of the base station performs detectionon the transmission resource.

Specifically, after the base station allocates the same transmissionresource to the first UE and the second UE, the base station sends abroadcast message, where the broadcast message carries a transmissionresource index allocated to the first UE and the second UE, so that theUE within the coverage of the base station performs detection on thetransmission resource. When receiving the broadcast message sent by thebase station, the third UE performs detection on the transmissionresource according to the transmission resource index carried in thebroadcast message. If the detection module successfully detects a signalon the transmission resource, but as the third UE moves, a change rangeof signal energy on the transmission resource is less than a presetthreshold, and no signal can be successfully detected on thetransmission resource again, and still no signal can be successfullydetected within a preset duration, the third UE determines that theresource collision exists between the first UE and the second UE, andthe third UE reports a resource collision indication to the basestation.

1005. When determining that the resource collision exists between thefirst UE and the second UE, the base station reallocates a transmissionresource to the first UE or the second UE.

Specifically, how to reallocate a transmission resource to the first UEor the second UE may be determined based on an allocation manner of thebase station. For example, for which UE reallocation is performed may bedetermined according to service priorities of the first UE and thesecond UE. If a service priority of the first UE is higher, atransmission resource may be reallocated to the second UE. Certainly,reallocation may also be performed for one of the UEs randomly, orreallocation may be performed for both UEs, as long as allocatedtransmission resources are different. This is not limited in thisembodiment of the present invention. Certainly, when reallocation isperformed for either of the UEs, reallocation may be performed accordingto a resource allocation manner provided by this embodiment of thepresent invention.

1006. The base station sends the allocated transmission resource to thefirst UE or the second UE.

In the method provided by this embodiment of the present invention, thebase station sends the resource multiplex message to the first UE andthe second UE, so that the first UE and the second UE send the locationinformation of the UEs to the base station periodically; when receivingthe location information sent by the first UE and the second UE, thebase station determines whether the distance between the first UE andthe second UE is less than the second preset distance; when the basestation determines that the distance between the first UE and the secondUE is less than the second preset distance, the base station determinesthat a resource collision exists between the first UE and the second UE,and reallocates a transmission resource to the first UE and the secondUE. Therefore, proper transmission resource allocation is implemented,and a transmission resource multiplex rate and a success rate ofcommunication between vehicles in the Internet of Vehicles areincreased.

FIG. 11 is a schematic structural diagram of a base station according toan embodiment of the present invention. Referring to FIG. 11, the basestation includes:

a receiving module 1101, configured to receive a resource allocationrequest sent by first user equipment UE, where the first UE is any UEwithin coverage of the base station;

an allocation module 1102, configured to allocate, if the resourceallocation request received by the receiving module 1101 carries atransmission resource index obtained by the first UE through listening,a transmission resource to the first UE according to the transmissionresource index; and

a sending module 1103, configured to send, to the first UE, thetransmission resource allocated by the allocation module 1102.

In an embodiment of the present invention, the sending module 1103 isfurther configured to send listening setting information to the UEwithin the coverage of the base station before the receiving module 1101receives the resource allocation request sent by the first UE, where thelistening setting information is used to notify the UE of a duration oflistening.

In an embodiment of the present invention, the sending module 1103 isspecifically configured to:

send radio resource control protocol RRC signaling to the UE within thecoverage of the base station, where the RRC signaling carries thelistening setting information; or

send a system information block SIB message to the UE within thecoverage of the base station, where the SIB message carries thelistening setting information; or

send control signaling to the UE within the coverage of the basestation, where the control signaling carries the listening settinginformation.

In an embodiment of the present invention, the sending module 1103 isfurther configured to send energy threshold information to the UE withinthe coverage of the base station before the receiving module 1101receives the resource allocation request sent by the first UE, where theenergy threshold information is used to notify the UE of a first energythreshold in listening.

In an embodiment of the present invention, the sending module 1103 isspecifically configured to:

send RRC signaling to the UE within the coverage of the base station,where the RRC signaling carries the energy threshold information; or

send a SIB message to the UE within the coverage of the base station,where the SIB message carries the energy threshold information; or

send control signaling to the UE within the coverage of the basestation, where the control signaling carries the energy thresholdinformation.

In an embodiment of the present invention, the sending module 1103 isfurther configured to send quantity setting information to the UE withinthe coverage of the base station before the receiving module 1101receives the resource allocation request sent by the first UE, where thequantity setting information is used to notify the UE of a quantity oftransmission resource indexes to be carried when the resource allocationrequest is sent.

In an embodiment of the present invention, the base station furtherincludes:

a judging module, configured to determine, if the resource allocationrequest does not carry any transmission resource index, whether the basestation has any unallocated transmission resource; where

when the judging module determines that the base station has anunallocated transmission resource, the allocation module 1102 is furtherconfigured to allocate the unallocated transmission resource to thefirst UE; or

an obtaining module, configured to obtain location information of thefirst UE when a judging module determines that all transmissionresources of the base station are already allocated; and

a determining module, configured to determine, according to the locationinformation of the first UE that is obtained by the obtaining module andlocation information of UEs to which the allocation module 1102currently has already allocated transmission resources, second UE thatmeets a preset condition, where the preset condition is that a distancebetween the second UE and the first UE is greater than a first presetdistance; where

the allocation module 1102 is further configured to allocate, to thefirst UE, a transmission resource already allocated to the second UEdetermined by the determining module.

In an embodiment of the present invention, the receiving module 1101 isfurther configured to receive the location information of the first UE;and

the obtaining module is configured to obtain the location informationreceived by the receiving module 1101, as the location information ofthe first UE; or

the obtaining module is configured to determine the location informationof the first UE according to a transmit signal of the first UE; or

the obtaining module is configured to use location information of thefirst UE that is previously obtained by the obtaining module, as currentlocation information of the first UE.

In an embodiment of the present invention, the receiving module 1101 isspecifically configured to:

receive global positioning system GPS location information of the firstUE; or receive estimated location information of the first UE, where theestimated location information is location information obtained by thefirst UE through estimation according to a positioning reference signaltransmitted by the base station; or receive area index information of anarea in which the first UE is currently located.

In an embodiment of the present invention, the obtaining module isspecifically configured to: determine a relative azimuth between thefirst UE and the base station according to the transmit signal of thefirst UE; and determine a distance between the first UE and the basestation according to a detected energy value of the transmit signal ofthe first UE.

In an embodiment of the present invention, the transmit signal of thefirst UE is:

a physical uplink control channel PUCCH signal; or

a physical uplink shared channel PUSCH signal; or

a random access channel RACH; or

a PUCCH signal used to carry a scheduling request SR; or

a PUSCH signal used to carry a buffer status report BSR; or

a communication signal between the first UE and another UE.

In an embodiment of the present invention, the base station furtherincludes:

a collision determining module, configured to determine whether aresource collision exists between the first UE and the second UE; where

the allocation module 1102 is further configured to reallocate atransmission resource to the first UE or the second UE when thecollision determining module confirms that the resource collision existsbetween the first UE and the second UE.

In an embodiment of the present invention, the sending module 1103 isfurther configured to send a resource multiplex message to the first UEand the second UE separately after the allocation module 1102 allocates,to the first UE, the transmission resource already allocated to thesecond UE determined by the determining module, where the resourcemultiplex message is used to notify that the same transmission resourceis allocated to the first UE and the second UE.

In an embodiment of the present invention, the collision determiningmodule is specifically configured to: determine, in real time accordingto the location information of the first UE and location information ofthe second UE, whether the distance between the first UE and the secondUE is less than a second preset distance; and when confirming that thedistance between the first UE and the second UE is less than the secondpreset distance, determine that the resource collision exists betweenthe first UE and the second UE.

In an embodiment of the present invention, the collision determiningmodule is further configured to:

when the receiving module 1101 receives a resource collision messagesent by the first UE, determine that the resource collision existsbetween the first UE and the second UE, where the resource collisionmessage is obtained by the first UE by performing detection on thetransmission resource at a silent time; or when the receiving module1101 receives a resource collision message sent by the second UE,determine that the resource collision exists between the first UE andthe second UE, where the resource collision message is obtained by thesecond UE by performing detection on the transmission resource at asilent time.

In an embodiment of the present invention, the sending module 1103 isfurther configured to send silence setting information to the first UEand the second UE separately after the allocation module 1102 allocates,to the first UE, the transmission resource already allocated to thesecond UE determined by the determining module, where the silencesetting information is used to instruct the UEs to keep silent in aspecified transmission timeslot.

In an embodiment of the present invention, when the receiving module1101 receives a resource collision message sent by third UE, thecollision determining module is further configured to determine that theresource collision exists between the first UE and the second UE, wherethe third UE is UE different from the first UE and the second UE withinthe coverage of the base station, and the resource collision message isobtained by the third UE by performing detection on the transmissionresource.

In an embodiment of the present invention, the sending module 1103 isfurther configured to send a broadcast message to the UE within thecoverage of the base station, where the broadcast message carries atransmission resource index allocated to the first UE and the second UE,and the transmission resource index is used by the UE within thecoverage of the base station to perform detection on the transmissionresource.

The foregoing base station may be configured to perform the resourceallocation method performed by the base station in the embodimentscorresponding to FIG. 2, subsequent FIG. 7, FIG. 8, and the like. Aspecific execution process is already described in detail in theforegoing method embodiments, and is not described again herein.

FIG. 12 is a schematic structural diagram of user equipment according toan embodiment of the present invention. Referring to FIG. 12, the userequipment includes:

a receiving module 1201, configured to receive listening settinginformation, where the listening setting information is used to notifythe UE of a duration of listening;

a determining module 1202, configured to determine, according to thelistening setting information received by the receiving module 1201, aduration of listening to be performed on transmission resources withincoverage of a base station;

a listening module 1203, configured to listen to the transmissionresources within the coverage of the base station; and

a sending module 1204, configured to send a resource allocation requestto the base station when a duration of the listening performed by thelistening module 1203 reaches the preset duration determined by thedetermining module 1202, so that the base station allocates atransmission resource according to the resource allocation request;where

the receiving module 1201 is further configured to receive thetransmission resource allocated by the base station.

In an embodiment of the present invention, the listening module 1203 isspecifically configured to: perform energy detection on the transmissionresource to obtain a detected energy value; and when the detected energyvalue is less than a first energy threshold, obtain a transmissionresource index of the transmission resource.

In an embodiment of the present invention, the resource allocationrequest carries the transmission resource index of the transmissionresource.

In an embodiment of the present invention, the receiving module 1201 isfurther configured to receive energy threshold information from the basestation before the listening module 1203 listens to the transmissionresources within the coverage of the base station, where the energythreshold information is used to notify the UE of the first energythreshold in listening.

In an embodiment of the present invention, before the listening module1203 listens to the transmission resources within the coverage of thebase station, the receiving module 1201 is further configured to receivequantity setting information sent by the base station, where thequantity setting information is used to notify the UE of a quantity oftransmission resource indexes to be carried when the resource allocationrequest is sent.

In an embodiment of the present invention, the sending module 1204 isfurther configured to send location information of the user equipment tothe base station when it is determined that no transmission resourcelistened to by the listening module 1203 is idle.

In an embodiment of the present invention, the sending module 1204 isspecifically configured to:

send GPS location information to the base station; or send estimatedlocation information to the base station, where the estimated locationinformation is location information obtained by the user equipmentthrough estimation according to a positioning reference signaltransmitted by the base station; or send area index information of anarea in which the user equipment is currently located to the basestation.

In an embodiment of the present invention, after receiving thetransmission resource allocated by the base station, the receivingmodule 1201 is further configured to receive a resource multiplexmessage sent by the base station; and

the sending module 1204 is further configured to periodically sendlocation information of the user equipment to the base station, so thatthe base station determines, according to the location information ofthe user equipment, whether a resource collision exists.

In an embodiment of the present invention, after receiving thetransmission resource allocated by the base station, the receivingmodule 1201 is further configured to receive silence setting informationsent by the base station, where the silence setting information is usedto instruct the UE to keep silent in a specified transmission timeslot;and

the user equipment further includes:

a silence module, configured to keep silent in the specifiedtransmission timeslot according to the silence setting informationreceived by the receiving module 1201;

a resource collision determining module 1202, configured to determine,when it is detected that a detected energy value of the transmissionresource occupied by the user equipment in the specified transmissiontimeslot determined by the silence module is greater than a secondenergy threshold, that a resource collision exists; and

a message generation module, configured to generate a resource collisionmessage when the resource collision determining module 1202 determinesthat the resource collision exists; where

the sending module 1204 is further configured to send the resourcecollision message generated by the message generation module to the basestation.

The foregoing user equipment may be configured to perform the resourceallocation method performed by the user equipment in the embodimentscorresponding to FIG. 3, subsequent FIG. 7, FIG. 8, and the like. Aspecific execution process is already described in detail in theforegoing method embodiments, and is not described again herein.

FIG. 13 is a schematic structural diagram of user equipment according toan embodiment of the present invention. Referring to FIG. 13, the userequipment includes:

a receiving module 1301, configured to receive a broadcast message,where the broadcast message carries a transmission resource indexallocated to first UE and second UE;

a detection module 1302, configured to perform detection on atransmission resource according to the transmission resource indexreceived by the receiving module 1301;

a generation module 1303, configured to generate a resource collisionmessage when the detection module 1302 determines that a resourcecollision exists on the transmission resource; and

a sending module 1304, configured to send the resource collision messagegenerated by the generation module 1303 to a base station, so that thebase station determines, according to the resource collision message,that the resource collision exists between the first UE and the secondUE.

In an embodiment of the present invention, the detection module 1302 isspecifically configured to: perform detection on the transmissionresource corresponding to the transmission resource index received bythe receiving module 1301; and if a signal is successfully detected onthe transmission resource, but as the user equipment moves, a changerange of signal energy on the transmission resource is less than apreset threshold, and no signal can be successfully detected on thetransmission resource again, and still no signal can be successfullydetected within a preset duration, determine that the resource collisionexists between the first UE and the second UE.

The foregoing user equipment may be configured to perform the resourceallocation method performed by the user equipment in the embodimentscorresponding to FIG. 4, subsequent FIG. 7, FIG. 8, and the like. Aspecific execution process is already described in detail in theforegoing method embodiments, and is not described again herein.

FIG. 14 is a schematic structural diagram of a base station according toan embodiment of the present invention. Referring to FIG. 14, the basestation includes:

a receiving module 1401, configured to receive a resource allocationrequest from first UE, where the first UE is any UE within coverage ofthe base station;

an obtaining module 1402, configured to obtain location information ofthe first UE;

a determining module 1403, configured to determine, according to thelocation information of the first UE that is obtained by the obtainingmodule 1402 and location information of UEs to which transmissionresources are currently already allocated, second UE that meets a presetcondition, where the preset condition is that a distance between thesecond UE and the first UE is greater than a first preset distance;

an allocation module 1404, configured to allocate, to the first UE, atransmission resource already allocated to the second UE determined bythe determining module 1403; and

a sending module 1405, configured to send, to the first UE, thetransmission resource allocated by the allocation module 1404.

In an embodiment of the present invention, the obtaining module 1402 isspecifically configured to: obtain location information received by thereceiving module 1401, as the location information of the first UE; orthe obtaining module 1402 is configured to determine the locationinformation of the first UE according to a transmit signal of the firstUE; or the obtaining module 1402 is configured to use locationinformation of the first UE that is previously obtained, as currentlocation information of the first UE.

In an embodiment of the present invention, the receiving module 1401 isspecifically configured to:

receive GPS location information of the first UE; or receive estimatedlocation information of the first UE, where the estimated locationinformation is location information obtained by the first UE throughestimation according to a positioning reference signal transmitted bythe base station; or receive area index information of an area in whichthe first UE is currently located.

In an embodiment of the present invention, the obtaining module 1402 isspecifically configured to: determine a relative azimuth between thefirst UE and the base station according to the transmit signal of thefirst UE; and determine a distance between the first UE and the basestation according to a detected energy value of the transmit signal ofthe first UE.

In an embodiment of the present invention, the transmit signal of thefirst UE is:

a physical uplink control channel PUCCH signal; or a physical uplinkshared channel PUSCH signal; or a random access channel RACH; or a PUCCHsignal used to carry a scheduling request SR; or a PUSCH signal used tocarry a buffer status report BSR; or a communication signal between thefirst UE and another UE.

In an embodiment of the present invention, the base station furtherincludes:

a collision determining module, configured to determine whether aresource collision exists between the first UE and the second UE; where

the allocation module 1404 is further configured to reallocate atransmission resource to the first UE or the second UE when the resourcedetermining module determines that the resource collision exists betweenthe first UE and the second UE.

In an embodiment of the present invention, the sending module 1405 isfurther configured to send a resource multiplex message to the first UEand the second UE separately after sending, to the first UE, thetransmission resource allocated by the allocation module 1404, where theresource multiplex message is used to notify that the same transmissionresource is allocated to the first UE and the second UE.

In an embodiment of the present invention, the collision determiningmodule is specifically configured to: determine, in real time accordingto the location information of the first UE and location information ofthe second UE, whether the distance between the first UE and the secondUE is less than a second preset distance; and when confirming that thedistance between the first UE and the second UE is less than the secondpreset distance, determine that the resource collision exists betweenthe first UE and the second UE.

In an embodiment of the present invention, the collision determiningmodule is specifically configured to: when the receiving module 1401receives a resource collision message sent by the first UE, determinethat the resource collision exists between the first UE and the secondUE, where the resource collision message is obtained by the first UE byperforming detection on the transmission resource at a silent time; orwhen the receiving module 1401 receives a resource collision messagesent by the second UE, determine that the resource collision existsbetween the first UE and the second UE, where the resource collisionmessage is obtained by the second UE by performing detection on thetransmission resource at a silent time.

In an embodiment of the present invention, the sending module 1405 isfurther configured to send silence setting information to the first UEand the second UE separately after sending, to the first UE, thetransmission resource allocated by the allocation module 1404, where thesilence setting information is used to instruct the UEs to keep silentin a specified transmission timeslot.

In an embodiment of the present invention, when the receiving module1401 receives a resource collision message sent by third UE, thecollision determining module is specifically configured to determinethat the resource collision exists between the first UE and the secondUE, where the third UE is UE different from the first UE and the secondUE within the coverage of the base station, and the resource collisionmessage is obtained by the third UE by performing detection on thetransmission resource.

In an embodiment of the present invention, the sending module 1405 isfurther configured to send a broadcast message to the UE within thecoverage of the base station after sending, to the first UE, thetransmission resource allocated by the allocation module 1404, where thebroadcast message carries a transmission resource index allocated to thefirst UE and the second UE, and the transmission resource index is usedby the UE within the coverage of the base station to perform detectionon the transmission resource.

The foregoing base station may be configured to perform the resourceallocation method performed by the base station in the embodimentscorresponding to FIG. 5, subsequent FIG. 9, FIG. 10, and the like. Aspecific execution process is already described in detail in theforegoing method embodiments, and is not described again herein.

FIG. 15 is a schematic structural diagram of user equipment according toan embodiment of the present invention. Referring to FIG. 15, the userequipment includes:

a sending module 1501, configured to send a resource allocation requestto a base station; where

the sending module 1501 is configured to send location information ofthe user equipment to the base station, so that the base stationallocates a transmission resource according to the location informationof the user equipment and location information of UEs to whichtransmission resources are currently already allocated; and

a receiving module 1502, configured to receive the transmission resourceallocated by the base station.

In an embodiment of the present invention, the sending module 1501 isspecifically configured to:

send GPS location information to the base station; or send estimatedlocation information to the base station, where the estimated locationinformation is location information obtained by the user equipmentthrough estimation according to a positioning reference signaltransmitted by the base station; or send area index information of anarea in which the user equipment is currently located to the basestation.

In an embodiment of the present invention, after receiving thetransmission resource allocated by the base station, the receivingmodule 1502 is further configured to receive a resource multiplexmessage sent by the base station; and

the sending module 1501 is further configured to periodically send thelocation information of the user equipment to the base station, so thatthe base station determines, according to the location information ofthe user equipment, whether a resource collision exists.

In an embodiment of the present invention, after receiving thetransmission resource allocated by the base station, the receivingmodule 1502 is further configured to receive silence setting informationsent by the base station, where the silence setting information is usedto instruct the UE to keep silent in a specified transmission timeslot;and

the user equipment further includes:

a silence module, configured to keep silent in the specifiedtransmission timeslot according to the silence setting informationreceived by the receiving module 1502;

a detection module, configured to perform detection on the transmissionresource occupied by the user equipment in the specified transmissiontimeslot when the silence module keeps silent;

a collision determining module, configured to determine, when thedetection module detects that a detected energy value of thetransmission resource occupied by the user equipment is greater than asecond energy threshold, that a resource collision exists; and

a generation module, configured to generate a resource collision messagewhen the collision determining module determines that the resourcecollision exists; where

the sending module 1501 is further configured to send the resourcecollision message generated by the generation module to the basestation.

The foregoing user equipment may be configured to perform the resourceallocation method performed by the user equipment in the embodimentscorresponding to FIG. 6, subsequent FIG. 9, FIG. 10, and the like. Aspecific execution process is already described in detail in theforegoing method embodiments, and is not described again herein.

Referring to FIG. 16, FIG. 16 is a schematic structural diagram of abase station according to an embodiment of the present invention. Asshown in FIG. 16, the base station includes a transmitter 1601, areceiver 1602, a memory 1603, and a processor 1604 that is connected tothe transmitter 1601, the receiver 1602, and the memory 1603 separately.Certainly, the base station may further include a universal componentsuch as an antenna, a baseband processing component, an intermediateradio frequency processing component, or an input/output apparatus. Thisis no longer limited in this embodiment of the present invention.

The memory stores a group of program code, and the processor 1604 isconfigured to invoke the program code stored in the memory, so that theprocessor 1604 is configured to perform each operation in the foregoingresource allocation method.

Referring to FIG. 17, FIG. 17 is a schematic structural diagram of userequipment according to an embodiment of the present invention. As shownin FIG. 17, the user equipment includes a transmitter 1701, a receiver1702, a memory 1703, and a processor 1704 that is connected to thetransmitter 1701, the receiver 1702, and the memory 1703 separately.Certainly, the user equipment may further include a universal componentsuch as an antenna, a baseband processing component, an intermediateradio frequency processing component, or an input/output apparatus. Thisis no longer limited in this embodiment of the present invention.

The memory stores a group of program code, and the processor isconfigured to invoke the program code stored in the memory, so that theprocessor is configured to perform each operation in the foregoingresource allocation method.

A person of ordinary skill in the art may understand that all or some ofthe steps of the embodiments may be implemented by hardware or a programinstructing related hardware. The program may be stored in acomputer-readable storage medium. The storage medium may include: aread-only memory, a magnetic disk, or an optical disc.

The foregoing descriptions are merely example embodiments of the presentinvention, but are not intended to limit the present invention. Anymodification, equivalent replacement, and improvement made withoutdeparting from the spirit and principle of the present invention shallfall within the protection scope of the present invention.

What is claimed is:
 1. A communication apparatus, wherein thecommunication apparatus comprises: a receiver, configured to receive aresource allocation request from first user equipment (UE), wherein thefirst UE is any UE within coverage of the base station; a processor,configured to obtain location information of the first UE; theprocessor, configured to determine, according to the locationinformation of the first UE and location information of UEs to whichtransmission resources are currently already allocated, second UE thatmeets a preset condition, wherein the preset condition is that adistance between the second UE and the first UE is greater than a firstpreset distance; the processor, configured to allocate, to the first UE,a transmission resource already allocated to the second UE; and atransmitter, configured to send, to the first UE, the transmissionresource allocated by the processor.
 2. The communication apparatusaccording to claim 1, wherein the processor is specifically configuredto: obtain location information received by the receiver, as thelocation information of the first UE; or determine the locationinformation of the first UE according to a transmit signal of the firstUE; or use location information of the first UE that is previouslyobtained, as current location information of the first UE.
 3. Thecommunication apparatus according to claim 2, wherein the receiver isspecifically configured to: receive global positioning system (GPS)location information of the first UE; or receive estimated locationinformation of the first UE, wherein the estimated location informationis location information obtained by the first UE through estimationaccording to a positioning reference signal transmitted by the basestation; or receive area index information of an area in which the firstUE is currently located.
 4. The communication apparatus according toclaim 2, wherein the processor is specifically configured to: determinea relative azimuth between the first UE and the base station accordingto the transmit signal of the first UE; and determine a distance betweenthe first UE and the base station according to a detected energy valueof the transmit signal of the first UE.
 5. The communication apparatusaccording to claim 1, wherein the transmitter is further configured tosend a resource multiplex message to the first UE and the second UEseparately after sending, to the first UE, the transmission resourceallocated by the processor, wherein the resource multiplex message isused to notify that the same transmission resource is allocated to thefirst UE and the second UE.
 6. The communication apparatus according toclaim 1, wherein the processor is further configured to: determinewhether a resource collision exists between the first UE and the secondUE; reallocate a transmission resource to the first UE or the second UE.7. The communication apparatus according to claim 6, wherein theprocessor is specifically configured to: determine, in real timeaccording to the location information of the first UE and locationinformation of the second UE, whether the distance between the first UEand the second UE is less than a second preset distance; and whenconfirming that the distance between the first UE and the second UE isless than the second preset distance, determine that the resourcecollision exists between the first UE and the second UE.
 8. Thecommunication apparatus n according to claim 6, wherein the processor isspecifically configured to: when the receiver receives a resourcecollision message sent by the first UE, determine that the resourcecollision exists between the first UE and the second UE, wherein theresource collision message is obtained by the first UE by performingdetection on the transmission resource at a silent time; or when thereceiver receives a resource collision message sent by the second UE,determine that the resource collision exists between the first UE andthe second UE, wherein the resource collision message is obtained by thesecond UE by performing detection on the transmission resource at asilent time.
 9. The communication apparatus according to claim 6,wherein the transmitter is further configured to: send silence settinginformation to the first UE and the second UE separately after sending,to the first UE, the transmission resource allocated by the processor,wherein the silence setting information is used to instruct the UEs tokeep silent in a specified transmission timeslot.
 10. The communicationapparatus, according to claim 6, wherein when the receiver receives aresource collision message sent by third UE, the processor isspecifically configured to determine that the resource collision existsbetween the first UE and the second UE, wherein the third UE is UEdifferent from the first UE and the second UE within the coverage of thebase station, and the resource collision message is obtained by thethird UE by performing detection on the transmission resource.
 11. Aresource allocation method, wherein the method comprises: receiving aresource allocation request from first UE, wherein the first userequipment (UE) is any UE within coverage of a base station; obtaininglocation information of the first UE; determining, according to thelocation information of the first UE and location information of UEs towhich transmission resources are currently already allocated, second UEthat meets a preset condition, wherein the preset condition is that adistance between the second UE and the first UE is greater than a firstpreset distance; allocating, to the first UE, a transmission resourcealready allocated to the second UE; and sending the allocatedtransmission resource to the first UE.
 12. The method according to claim11, wherein the obtaining location information of the first UEcomprises: receiving the location information of the first UE; ordetermining the location information of the first UE according to atransmit signal of the first UE; or using previously obtained locationinformation of the first UE as current location information of the firstUE.
 13. The method according to claim 12, wherein the receiving thelocation information sent by the first UE comprises: receiving globalpositioning system (GPS) location information of the first UE; orreceiving estimated location information of the first UE, wherein theestimated location information is location information obtained by thefirst UE through estimation according to a positioning reference signaltransmitted by the base station; or receiving area index information ofan area in which the first UE is currently located.
 14. The methodaccording to claim 12, wherein the determining the location informationof the first UE according to a transmit signal of the first UEcomprises: determining a relative azimuth between the first UE and thebase station according to the transmit signal of the first UE; anddetermining a distance between the first UE and the base stationaccording to a detected energy value of the transmit signal of the firstUE.
 15. The method according to claim 12, wherein after the sending theallocated transmission resource to the first UE, the method furthercomprises: sending a resource multiplex message to the first UE and thesecond UE separately, wherein the resource multiplex message is used tonotify that the same transmission resource is allocated to the first UEand the second UE.
 16. The method according to claim 12, wherein thedetermining whether a resource collision exists between the first UE andthe second UE comprises: determining, in real time according to thelocation information of the first UE and location information of thesecond UE, whether the distance between the first UE and the second UEis less than a second preset distance; and when confirming that thedistance between the first UE and the second UE is less than the secondpreset distance, determining that the resource collision exists betweenthe first UE and the second UE.
 17. The method according to claim 15,wherein the determining whether a resource collision exists between thefirst UE and the second UE comprises: when receiving a resourcecollision message sent by the first UE, determining that the resourcecollision exists between the first UE and the second UE, wherein theresource collision message is obtained by the first UE by performingdetection on the transmission resource at a silent time; or whenreceiving a resource collision message sent by the second UE,determining that the resource collision exists between the first UE andthe second UE, wherein the resource collision message is obtained by thesecond UE by performing detection on the transmission resource at asilent time.
 18. The method according to claim 15, wherein before thedetermining whether a resource collision exists between the first UE andthe second UE, the method further comprises: sending silence settinginformation to the first UE and the second UE separately, wherein thesilence setting information is used to instruct the UEs to keep silentin a specified transmission timeslot.
 19. The method according to claim15, wherein the determining whether a resource collision exists betweenthe first UE and the second UE comprises: when receiving a resourcecollision message sent by third UE, determining that the resourcecollision exists between the first UE and the second UE, wherein thethird UE is UE different from the first UE and the second UE within thecoverage of the base station, and the resource collision message isobtained by the third UE by performing detection on the transmissionresource.
 20. The method according to claim 15, wherein before thedetermining whether a resource collision exists between the first UE andthe second UE, the method further comprises: sending a broadcast messageto the UE within the coverage of the base station, wherein the broadcastmessage carries a transmission resource index allocated to the first UEand the second UE, and the transmission resource index is used by the UEwithin the coverage of the base station to perform detection on thetransmission resource.